don't enable wpa if wep is set
authorFelix Fietkau <nbd@openwrt.org>
Mon, 27 Jun 2005 09:21:48 +0000 (09:21 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 27 Jun 2005 09:21:48 +0000 (09:21 +0000)
SVN-Revision: 1289

openwrt/package/wificonf/wificonf.c

index 8df932f1e236e2fa533bb973c642ae5c74c5f6ef..4a5f2fc6cf18d4618bae94e7584154194ad3b9cf 100644 (file)
@@ -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 */