[PATCH]: enable 'DISABLE_NETWORK all' ctrl_iface command
Kel Modderman
kel
Sun Jan 13 01:55:26 PST 2008
Allow 'DISABLE_NETWORK all' ctrl_iface command to disable all networks in
current configuration. Disassociate if a network is currently selected.
Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -688,7 +688,20 @@
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: DISABLE_NETWORK all");
+ ssid = wpa_s->conf->ssid;
+ while (ssid) {
+ ssid->disabled = 1;
+ ssid = ssid->next;
+ }
+ if (wpa_s->current_ssid)
+ wpa_supplicant_disassociate(wpa_s,
+ WLAN_REASON_DEAUTH_LEAVING);
+ return 0;
+ }
+
id = atoi(cmd);
wpa_printf(MSG_DEBUG, "CTRL_IFACE: DISABLE_NETWORK id=%d", id);
---
More information about the Hostap
mailing list