[PATCH]: enable 'ENABLE_NETWORK all' ctrl_iface command

Kel Modderman kel
Sun Jan 13 01:51:24 PST 2008


Allow 'ENABLE_NETWORK all' ctrl_iface command to enable all networks in
current configuration. Reassociate if the currently selected network is
disabled.

Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -644,7 +644,21 @@
 	int id;
 	struct wpa_ssid *ssid;
 
-	/* cmd: "<network id>" */
+	/* cmd: "<network id>" or "all" */
+	if (os_strcmp(cmd, "all") == 0) {
+		wpa_printf(MSG_DEBUG, "CTRL_IFACE: ENABLE_NETWORK all");
+		ssid = wpa_s->conf->ssid;
+		while (ssid) {
+			if (ssid == wpa_s->current_ssid && ssid->disabled)
+				wpa_s->reassociate = 1;
+			ssid->disabled = 0;
+			ssid = ssid->next;
+		}
+		if (wpa_s->reassociate)
+			wpa_supplicant_req_scan(wpa_s, 0, 0);
+		return 0;
+	}
+
 	id = atoi(cmd);
 	wpa_printf(MSG_DEBUG, "CTRL_IFACE: ENABLE_NETWORK id=%d", id);
 
---



More information about the Hostap mailing list