enable_network command fubar'd?

Kel Modderman kel
Sat May 1 18:21:39 PDT 2010


On Sunday 02 May 2010 11:02:26 Kel Modderman wrote:
> Hi Jouni,
> 
> I've been looking at new bugs in wpa_gui (0.7.2) and found that I am unable to
> enable newly created networks. I thought it was a problem with the gui but
> could reproduce with wpa_cli:
> 
> > list_networks
> network id / ssid / bssid / flags
> 0       configap        any     [CURRENT]
> > add_network
> 1
> > set_network 1 ssid "foo"
> OK
> > enable_network 1
> OK
> > list_networks
> network id / ssid / bssid / flags
> 0       configap        any     [CURRENT]
> 1       foo     any     [DISABLED]
> 
> Can you reproduce this?

Enable a network block, even if there is a current configuration, if it was
disabled.

Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1392,13 +1392,15 @@ void wpa_supplicant_enable_network(struc
 		}
 		if (wpa_s->reassociate)
 			wpa_supplicant_req_scan(wpa_s, 0, 0);
-	} else if (wpa_s->current_ssid == NULL && ssid->disabled) {
-		/*
-		 * Try to reassociate since there is no current configuration
-		 * and a new network was made available.
-		 */
-		wpa_s->reassociate = 1;
-		wpa_supplicant_req_scan(wpa_s, 0, 0);
+	} else if (ssid->disabled) {
+		if (wpa_s->current_ssid == NULL) {
+			/*
+			 * Try to reassociate since there is no current configuration
+			 * and a new network was made available.
+			 */
+			wpa_s->reassociate = 1;
+			wpa_supplicant_req_scan(wpa_s, 0, 0);
+		}
 
 		was_disabled = ssid->disabled;
 
---



More information about the Hostap mailing list