Changeset 12075


Ignore:
Timestamp:
05/09/09 16:12:20 (4 years ago)
Author:
BrainSlayer
Message:

small fix

Location:
src/router
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/networking/madwifi.c

    r12074 r12075  
    972972    { 
    973973        sysprintf( "iwpriv %s maccmd 2", iface ); 
     974        sleep(1); 
    974975        sysprintf( "ifconfig %s up", iface ); 
    975976        char nvlist[32]; 
     
    984985    { 
    985986        sysprintf( "iwpriv %s maccmd 1", iface ); 
     987        sleep(1); 
    986988        sysprintf( "ifconfig %s up", iface ); 
    987989 
     
    994996            sysprintf( "iwpriv %s addmac %s", iface, var ); 
    995997        } 
    996     }else //undefined condition 
     998    }else{ 
     999        sleep(1); 
     1000 //undefined condition 
    9971001        sysprintf( "ifconfig %s up", iface ); 
     1002    } 
    9981003 
    9991004} 
     
    17051710        } 
    17061711    } 
     1712 
     1713 
     1714 
     1715 
     1716 
    17071717    sysprintf( "iwconfig %s txpower %ddBm", dev, newpower ); 
    17081718 
    17091719    setMacFilter( dev ); 
    1710  
    1711  
    1712  
    1713  
    1714  
    17151720} 
    17161721 
     
    20532058        } 
    20542059    } 
    2055  
    2056  
     2060if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) < 0 ) 
     2061    return; 
     2062    struct ifreq ifr; 
     2063 
     2064#ifdef HAVE_RB500 
     2065    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2066    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2067    { 
     2068        char eabuf[32]; 
     2069 
     2070        nvram_set( "wl0_hwaddr", 
     2071                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2072    } 
     2073#endif 
     2074#ifdef HAVE_X86 
     2075    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2076    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2077    { 
     2078        char eabuf[32]; 
     2079 
     2080        nvram_set( "wl0_hwaddr", 
     2081                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2082    } 
     2083#endif 
     2084#ifdef HAVE_XSCALE 
     2085    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2086    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2087    { 
     2088        char eabuf[32]; 
     2089 
     2090        nvram_set( "wl0_hwaddr", 
     2091                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2092    } 
     2093#endif 
     2094#ifdef HAVE_MAGICBOX 
     2095    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2096    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2097    { 
     2098        char eabuf[32]; 
     2099 
     2100        nvram_set( "wl0_hwaddr", 
     2101                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2102    } 
     2103#endif 
     2104#ifdef HAVE_FONERA 
     2105    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2106    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2107    { 
     2108        char eabuf[32]; 
     2109 
     2110        nvram_set( "wl0_hwaddr", 
     2111                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2112    } 
     2113#endif 
     2114#ifdef HAVE_LS2 
     2115    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2116    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2117    { 
     2118        char eabuf[32]; 
     2119 
     2120        nvram_set( "wl0_hwaddr", 
     2121                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2122    } 
     2123#endif 
     2124#ifdef HAVE_LS5 
     2125    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2126    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2127    { 
     2128        char eabuf[32]; 
     2129 
     2130        nvram_set( "wl0_hwaddr", 
     2131                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2132    } 
     2133#endif 
     2134#ifdef HAVE_WHRAG108 
     2135    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2136    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2137    { 
     2138        char eabuf[32]; 
     2139 
     2140        nvram_set( "wl0_hwaddr", 
     2141                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2142    } 
     2143#endif 
     2144#ifdef HAVE_PB42 
     2145    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2146    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2147    { 
     2148        char eabuf[32]; 
     2149 
     2150        nvram_set( "wl0_hwaddr", 
     2151                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2152    } 
     2153#endif 
     2154#ifdef HAVE_LSX 
     2155    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2156    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2157    { 
     2158        char eabuf[32]; 
     2159 
     2160        nvram_set( "wl0_hwaddr", 
     2161                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2162    } 
     2163#endif 
     2164#ifdef HAVE_DANUBE 
     2165    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2166    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2167    { 
     2168        char eabuf[32]; 
     2169 
     2170        nvram_set( "wl0_hwaddr", 
     2171                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2172    } 
     2173#endif 
     2174#ifdef HAVE_STORM 
     2175    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2176    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2177    { 
     2178        char eabuf[32]; 
     2179 
     2180        nvram_set( "wl0_hwaddr", 
     2181                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2182    } 
     2183#endif 
     2184#ifdef HAVE_ADM5120 
     2185    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2186    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2187    { 
     2188        char eabuf[32]; 
     2189 
     2190        nvram_set( "wl0_hwaddr", 
     2191                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2192    } 
     2193#endif 
     2194#ifdef HAVE_TW6600 
     2195    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2196    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2197    { 
     2198        char eabuf[32]; 
     2199 
     2200        nvram_set( "wl0_hwaddr", 
     2201                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2202    } 
     2203#endif 
     2204#ifdef HAVE_CA8 
     2205    strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
     2206    if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
     2207    { 
     2208        char eabuf[32]; 
     2209 
     2210        nvram_set( "wl0_hwaddr", 
     2211                   ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
     2212    } 
     2213#endif 
     2214close(s); 
    20572215} 
    20582216 
  • src/router/services/networking/network.c

    r12073 r12075  
    18631863        } 
    18641864    } 
     1865fprintf(stderr,"%s:%d\n",__func__,__LINE__); 
    18651866    FORK(configure_wifi(  )); 
    1866  
     1867fprintf(stderr,"%s:%d\n",__func__,__LINE__); 
    18671868#endif 
    18681869#endif 
    18691870#ifdef HAVE_WAVESAT 
    1870     configure_wimax(  ); 
     1871    FORK(configure_wimax(  )); 
    18711872#endif 
    18721873    lan_ifname = strdup( nvram_safe_get( "lan_ifname" ) ); 
    18731874    lan_ifnames = strdup( nvram_safe_get( "lan_ifnames" ) ); 
     1875fprintf(stderr,"%s:%d\n",__func__,__LINE__); 
    18741876 
    18751877    /* 
     
    19081910 
    19091911    } 
     1912fprintf(stderr,"%s:%d\n",__func__,__LINE__); 
    19101913 
    19111914    /* 
     
    19141917    ifconfig( lan_ifname, IFUP, nvram_safe_get( "lan_ipaddr" ), 
    19151918              nvram_safe_get( "lan_netmask" ) ); 
     1919fprintf(stderr,"%s:%d\n",__func__,__LINE__); 
    19161920 
    19171921    char staticlan[32]; 
     
    20142018#endif 
    20152019    } 
    2016 #ifdef HAVE_RB500 
    2017     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2018     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2019     { 
    2020         char eabuf[32]; 
    2021  
    2022         nvram_set( "wl0_hwaddr", 
    2023                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2024     } 
    2025 #endif 
    2026 #ifdef HAVE_X86 
    2027     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2028     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2029     { 
    2030         char eabuf[32]; 
    2031  
    2032         nvram_set( "wl0_hwaddr", 
    2033                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2034     } 
    2035 #endif 
    2036 #ifdef HAVE_XSCALE 
    2037     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2038     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2039     { 
    2040         char eabuf[32]; 
    2041  
    2042         nvram_set( "wl0_hwaddr", 
    2043                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2044     } 
    2045 #endif 
    2046 #ifdef HAVE_MAGICBOX 
    2047     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2048     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2049     { 
    2050         char eabuf[32]; 
    2051  
    2052         nvram_set( "wl0_hwaddr", 
    2053                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2054     } 
    2055 #endif 
    2056 #ifdef HAVE_FONERA 
    2057     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2058     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2059     { 
    2060         char eabuf[32]; 
    2061  
    2062         nvram_set( "wl0_hwaddr", 
    2063                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2064     } 
    2065 #endif 
    2066 #ifdef HAVE_LS2 
    2067     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2068     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2069     { 
    2070         char eabuf[32]; 
    2071  
    2072         nvram_set( "wl0_hwaddr", 
    2073                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2074     } 
    2075 #endif 
    2076 #ifdef HAVE_LS5 
    2077     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2078     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2079     { 
    2080         char eabuf[32]; 
    2081  
    2082         nvram_set( "wl0_hwaddr", 
    2083                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2084     } 
    2085 #endif 
    2086 #ifdef HAVE_WHRAG108 
    2087     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2088     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2089     { 
    2090         char eabuf[32]; 
    2091  
    2092         nvram_set( "wl0_hwaddr", 
    2093                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2094     } 
    2095 #endif 
    2096 #ifdef HAVE_PB42 
    2097     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2098     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2099     { 
    2100         char eabuf[32]; 
    2101  
    2102         nvram_set( "wl0_hwaddr", 
    2103                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2104     } 
    2105 #endif 
    2106 #ifdef HAVE_LSX 
    2107     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2108     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2109     { 
    2110         char eabuf[32]; 
    2111  
    2112         nvram_set( "wl0_hwaddr", 
    2113                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2114     } 
    2115 #endif 
    2116 #ifdef HAVE_DANUBE 
    2117     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2118     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2119     { 
    2120         char eabuf[32]; 
    2121  
    2122         nvram_set( "wl0_hwaddr", 
    2123                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2124     } 
    2125 #endif 
    2126 #ifdef HAVE_STORM 
    2127     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2128     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2129     { 
    2130         char eabuf[32]; 
    2131  
    2132         nvram_set( "wl0_hwaddr", 
    2133                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2134     } 
    2135 #endif 
    2136 #ifdef HAVE_ADM5120 
    2137     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2138     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2139     { 
    2140         char eabuf[32]; 
    2141  
    2142         nvram_set( "wl0_hwaddr", 
    2143                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2144     } 
    2145 #endif 
    2146 #ifdef HAVE_TW6600 
    2147     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2148     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2149     { 
    2150         char eabuf[32]; 
    2151  
    2152         nvram_set( "wl0_hwaddr", 
    2153                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2154     } 
    2155 #endif 
    2156 #ifdef HAVE_CA8 
    2157     strncpy( ifr.ifr_name, "ath0", IFNAMSIZ ); 
    2158     if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 ) 
    2159     { 
    2160         char eabuf[32]; 
    2161  
    2162         nvram_set( "wl0_hwaddr", 
    2163                    ether_etoa( ifr.ifr_hwaddr.sa_data, eabuf ) ); 
    2164     } 
    2165 #endif 
    21662020 
    21672021    close( s ); 
  • src/router/shared/shutils.h

    r12071 r12075  
    218218    { \ 
    219219        case -1: \ 
    220             return; \ 
    221220            break; \ 
    222221        case 0: \ 
    223222            ( void )setsid(  ); \ 
     223            func; \ 
     224            exit(0); \ 
    224225            break; \ 
    225226        default: \ 
    226             return; \ 
     227        break; \ 
    227228    } \ 
    228     func; \ 
    229     exit(0); \ 
    230229}                        
    231230#endif 
Note: See TracChangeset for help on using the changeset viewer.