From: nbd Date: Mon, 27 Jun 2005 09:21:48 +0000 (+0000) Subject: don't enable wpa if wep is set X-Git-Url: http://git.rohieb.name/openwrt.git/commitdiff_plain/2c67854daa45a4cbf304663f368eeaeb128ca9bf?hp=8f8ea3a76e422bdc07c1b81cceec56fc1065496e don't enable wpa if wep is set git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1289 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 8df932f1e..4a5f2fc6c 100644 --- a/openwrt/package/wificonf/wificonf.c +++ b/openwrt/package/wificonf/wificonf.c @@ -155,20 +155,22 @@ void setup_bcom(int skfd, char *ifname) bcom_ioctl(skfd, ifname, WLC_DOWN, NULL, 0); - /* Set up WPA */ - if (nvram_match(wl_var("crypto"), "tkip")) - val = TKIP_ENABLED; - else if (nvram_match(wl_var("crypto"), "aes")) - val = AES_ENABLED; - else if (nvram_match(wl_var("crypto"), "tkip+aes")) - val = TKIP_ENABLED | AES_ENABLED; - else - val = 0; - bcom_ioctl(skfd, ifname, WLC_SET_WSEC, &val, sizeof(val)); - - if (val && nvram_get(wl_var("wpa_psk"))) { - val = 1; - bcom_ioctl(skfd, ifname, WLC_SET_EAP_RESTRICT, &val, sizeof(val)); + if (!nvram_enabled(wl_var("wep"))) { + /* Set up WPA */ + if (nvram_match(wl_var("crypto"), "tkip")) + val = TKIP_ENABLED; + else if (nvram_match(wl_var("crypto"), "aes")) + val = AES_ENABLED; + else if (nvram_match(wl_var("crypto"), "tkip+aes")) + val = TKIP_ENABLED | AES_ENABLED; + else + val = 0; + bcom_ioctl(skfd, ifname, WLC_SET_WSEC, &val, sizeof(val)); + + if (val && nvram_get(wl_var("wpa_psk"))) { + val = 1; + bcom_ioctl(skfd, ifname, WLC_SET_EAP_RESTRICT, &val, sizeof(val)); + } } /* Set up afterburner */