Changeset 10305


Ignore:
Timestamp:
09/11/08 12:24:16 (5 years ago)
Author:
eko
Message:

WDS-WPA: less code, faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/services/wpa.c

    r10292 r10305  
    4747    }; 
    4848    char *str = NULL; 
    49     int retries = 10; 
    50     char tmp[100], prefix[] = "wlXXXXXXXXXX_"; 
     49    char tmp[100], prefix[] = "wlXXXXXXXXXX_", pidfile[] = "/tmp/nas.wlXXXXXXXlan.pid"; 
    5150    int unit; 
    5251    char remote[ETHER_ADDR_LEN]; 
     
    5958    wl_ioctl( ifname, WLC_GET_INSTANCE, &unit, sizeof( unit ) ); 
    6059    snprintf( prefix, sizeof( prefix ), "wl%d_", unit ); 
    61     if( nvram_match( strcat_r( prefix, "akm", tmp ), "" ) && 
    62         nvram_match( strcat_r( prefix, "auth_mode", tmp ), "none" ) ) 
    63         return 0; 
    64  
    65     while( retries-- > 0 && !( str = file2str( "/tmp/nas.wl0lan.pid" ) ) ) 
    66         sleep( 1 ); 
    67     if( !str ) 
     60    snprintf( pidfile, sizeof( pidfile ), "/tmp/nas.wl%dlan.pid", unit ); 
     61 
     62    if( !( str = file2str( pidfile)) ) // no pidfile means no nas was run (required) 
    6863    { 
    6964        return -1; 
     
    420415                 
    421416            dev = nvram_nget( "wl%d_wds%d_if", c, s ); 
    422              
    423                 sleep (1);  
     417 
    424418        start_nas_notify (dev); 
    425419        } 
Note: See TracChangeset for help on using the changeset viewer.