Fix connecting to unsecured AP's.
authorRoy Marples <roy@marples.name>
Thu, 4 Dec 2014 21:19:01 +0000 (21:19 +0000)
committerRoy Marples <roy@marples.name>
Thu, 4 Dec 2014 21:19:01 +0000 (21:19 +0000)
src/libdhcpcd/wpa.c

index f066c879d7d08e1bdc237ef3ec747407c2f765a7..0d5da72e4c40f251c31f855546157a1c6ae5f51c 100644 (file)
@@ -1092,10 +1092,11 @@ dhcpcd_wpa_configure1(DHCPCD_WPA *wpa, DHCPCD_WI_SCAN *s, const char *psk)
                return DHCPCD_WPA_ERR;
 
        mgmt = dhcpcd_wpa_var_mgmt(s);
+       if (mgmt && !dhcpcd_wpa_network_set(wpa, id, "key_mgmt", mgmt))
+               return DHCPCD_WPA_ERR_SET;
+
        var = dhcpcd_wpa_var_psk(s);
-       if (mgmt && var) {
-               if (!dhcpcd_wpa_network_set(wpa, id, "key_mgmt", mgmt))
-                       return DHCPCD_WPA_ERR_SET;
+       if (var) {
 
                if (psk)
                        psk_len = strlen(psk);