diff options
author | Felix Fietkau <nbd@openwrt.org> | 2005-06-27 09:21:48 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2005-06-27 09:21:48 +0000 |
commit | b26cccd5b6fc8b7ca2cbc7c440487e120b2428a0 (patch) | |
tree | 2221e4f7b8891ef5564fe73cf01f20cbfdb41551 | |
parent | 8523556e0f0a6fae48a38ce5d102136a03662c47 (diff) | |
download | mtk-20170518-b26cccd5b6fc8b7ca2cbc7c440487e120b2428a0.zip mtk-20170518-b26cccd5b6fc8b7ca2cbc7c440487e120b2428a0.tar.gz mtk-20170518-b26cccd5b6fc8b7ca2cbc7c440487e120b2428a0.tar.bz2 |
don't enable wpa if wep is set
SVN-Revision: 1289
-rw-r--r-- | openwrt/package/wificonf/wificonf.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 8df932f..4a5f2fc 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 */ |