aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2013-03-10 15:51:13 (GMT)
committerJouni Malinen <j@w1.fi>2013-03-10 15:51:13 (GMT)
commit725fc39e07b3a9c92fd65f6bb66402824a18dda8 (patch)
treed85d4fa6addc124580587a876682e5407bd7bbf5 /wpa_supplicant/dbus
parent14f79078903d3cd9d1da2f9e18360fb4bb2f46c8 (diff)
downloadhostap-725fc39e07b3a9c92fd65f6bb66402824a18dda8.zip
hostap-725fc39e07b3a9c92fd65f6bb66402824a18dda8.tar.gz
hostap-725fc39e07b3a9c92fd65f6bb66402824a18dda8.tar.bz2
wpa_supplicant: Reschedule sched scan after network change
Stop sched scan, if running, after any disabling or removing of a network, and request a new scan if needed. Signed-hostap: David Spinadel <david.spinadel@intel.com>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 5e06932..8088755 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1479,6 +1479,7 @@ DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
char *iface = NULL, *net_id = NULL;
int id;
struct wpa_ssid *ssid;
+ int was_disabled;
dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &op,
DBUS_TYPE_INVALID);
@@ -1505,6 +1506,8 @@ DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
goto out;
}
+ was_disabled = ssid->disabled;
+
wpas_notify_network_removed(wpa_s, ssid);
if (wpa_config_remove_network(wpa_s->conf, id) < 0) {
@@ -1520,6 +1523,13 @@ DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
if (ssid == wpa_s->current_ssid)
wpa_supplicant_deauthenticate(wpa_s,
WLAN_REASON_DEAUTH_LEAVING);
+ else if (!was_disabled && wpa_s->sched_scanning) {
+ wpa_printf(MSG_DEBUG, "Stop ongoing sched_scan to remove "
+ "network from filters");
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+ wpa_supplicant_req_scan(wpa_s, 0, 0);
+ }
+
out:
os_free(iface);
@@ -1559,6 +1569,9 @@ static void remove_network(void *arg, struct wpa_ssid *ssid)
DBusMessage * wpas_dbus_handler_remove_all_networks(
DBusMessage *message, struct wpa_supplicant *wpa_s)
{
+ if (wpa_s->sched_scanning)
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+
/* NB: could check for failure and return an error */
wpa_config_foreach_network(wpa_s->conf, remove_network, wpa_s);
return NULL;