aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2012-09-09 13:57:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-09 13:57:57 -0700
commit164eea3ac2d53d1fecf20d76fd6b9f1920c17df4 (patch)
tree782feaaf79b8b2115dd1c4505fa0f306f8fdd711
parent8084af89d283ed015e28a5eb781726ae5e138cf0 (diff)
parenta831d78b5fb6af549533456cda57f88d73f6d153 (diff)
downloadexternal_wpa_supplicant_8-164eea3ac2d53d1fecf20d76fd6b9f1920c17df4.zip
external_wpa_supplicant_8-164eea3ac2d53d1fecf20d76fd6b9f1920c17df4.tar.gz
external_wpa_supplicant_8-164eea3ac2d53d1fecf20d76fd6b9f1920c17df4.tar.bz2
Merge "Fix REMOVE_NETWORK to not run operations with invalid current_ssid" into jb-mr1-dev
-rw-r--r--wpa_supplicant/ctrl_iface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 1203323..20a4086 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1881,8 +1881,7 @@ static int wpa_supplicant_ctrl_iface_remove_network(
ssid = wpa_config_get_network(wpa_s->conf, id);
if (ssid)
wpas_notify_network_removed(wpa_s, ssid);
- if (ssid == NULL ||
- wpa_config_remove_network(wpa_s->conf, id) < 0) {
+ if (ssid == NULL) {
wpa_printf(MSG_DEBUG, "CTRL_IFACE: Could not find network "
"id=%d", id);
return -1;
@@ -1906,6 +1905,12 @@ static int wpa_supplicant_ctrl_iface_remove_network(
wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
}
+ if (wpa_config_remove_network(wpa_s->conf, id) < 0) {
+ wpa_printf(MSG_DEBUG, "CTRL_IFACE: Not able to remove the "
+ "network id=%d", id);
+ return -1;
+ }
+
return 0;
}