[PATCH 1/3] wpa_supplicant: abort scan after removing all networks
Spinadel, David
david.spinadel
Tue Oct 30 00:43:47 PDT 2012
About scan - you are right, but I did it just to be clear here.
Regarding sched scan, I did think about this option. I'm not sure it's better to reschedule scan wherever network list is changed, because maybe it's better to send some redundant probe requests than rescheduling new scan. If you still think rescheduling is better, so go ahead with your patch when removing or disabling a network. In case of enabling there is other my patches.
Thanks,
David
> -----Original Message-----
> From: eshapira at gmail.com [mailto:eshapira at gmail.com] On Behalf Of Eyal
> Shapira
> Sent: Tuesday, October 30, 2012 09:22
> To: Spinadel, David
> Cc: hostap at lists.shmoo.com
> Subject: Re: [PATCH 1/3] wpa_supplicant: abort scan after removing all
> networks
>
> On 29 October 2012 11:13, <david.spinadel at intel.com> wrote:
> > From: David Spinadel <david.spinadel at intel.com>
> >
> > Change-Id: I737848dabed49d961985845f2e86f717c2926f0c
> > Reviewed-on: http://git-mwg.jer.intel.com/gerrit/3585
> > Reviewed-by: Jenkins
> > Tested-by: Jenkins
> > Reviewed-by: Max Stepanov <Max.Stepanov at intel.com>
> > Tested-by: Max Stepanov <Max.Stepanov at intel.com>
> > Signed-off-by: David Spinadel <david.spinadel at intel.com>
> > ---
> > wpa_supplicant/ctrl_iface.c | 7 +++++++
> > wpa_supplicant/dbus/dbus_new_handlers.c | 8 ++++++++
> > wpa_supplicant/dbus/dbus_old_handlers.c | 5 +++++
> > wpa_supplicant/wps_supplicant.c | 5 +++++
> > 4 files changed, 25 insertions(+), 0 deletions(-)
> >
> > diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> > index 0351241..d1a5cf6 100644
> > --- a/wpa_supplicant/ctrl_iface.c
> > +++ b/wpa_supplicant/ctrl_iface.c
> > @@ -2224,6 +2224,8 @@ static int
> wpa_supplicant_ctrl_iface_remove_network(
> > /* cmd: "<network id>" or "all" */
> > if (os_strcmp(cmd, "all") == 0) {
> > wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_NETWORK
> > all");
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_scan(wpa_s);
> > ssid = wpa_s->conf->ssid;
> > while (ssid) {
> > struct wpa_ssid *remove_ssid = ssid; @@
> > -2281,6 +2283,11 @@ static int
> wpa_supplicant_ctrl_iface_remove_network(
> > return -1;
> > }
> >
> > + if (!wpa_s->conf->ssid) {
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_scan(wpa_s);
> > + }
> > +
> > return 0;
> > }
> >
> > diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c
> > b/wpa_supplicant/dbus/dbus_new_handlers.c
> > index 00378be..b0f0d0e 100644
> > --- a/wpa_supplicant/dbus/dbus_new_handlers.c
> > +++ b/wpa_supplicant/dbus/dbus_new_handlers.c
> > @@ -1525,6 +1525,11 @@ DBusMessage *
> wpas_dbus_handler_remove_network(DBusMessage *message,
> > wpa_supplicant_deauthenticate(wpa_s,
> >
> > WLAN_REASON_DEAUTH_LEAVING);
> >
> > + if (!wpa_s->conf->ssid) {
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_scan(wpa_s);
> > + }
> > +
> > out:
> > os_free(iface);
> > os_free(net_id);
> > @@ -1562,6 +1567,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) {
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_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;
> > diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c
> > b/wpa_supplicant/dbus/dbus_old_handlers.c
> > index e217a72..ff60f6e 100644
> > --- a/wpa_supplicant/dbus/dbus_old_handlers.c
> > +++ b/wpa_supplicant/dbus/dbus_old_handlers.c
> > @@ -870,6 +870,11 @@ DBusMessage *
> wpas_dbus_iface_remove_network(DBusMessage *message,
> > WLAN_REASON_DEAUTH_LEAVING);
> > reply = wpas_dbus_new_success_reply(message);
> >
> > + if (!wpa_s->conf->ssid) {
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_scan(wpa_s);
> > + }
> > +
> > out:
> > os_free(iface);
> > os_free(net_id);
> > diff --git a/wpa_supplicant/wps_supplicant.c
> > b/wpa_supplicant/wps_supplicant.c index 41aa5db..87ea320 100644
> > --- a/wpa_supplicant/wps_supplicant.c
> > +++ b/wpa_supplicant/wps_supplicant.c
> > @@ -759,6 +759,11 @@ static void wpas_clear_wps(struct wpa_supplicant
> *wpa_s)
> > }
> >
> > wpas_wps_clear_ap_info(wpa_s);
> > +
> > + if (!wpa_s->conf->ssid) {
> > + wpa_supplicant_cancel_sched_scan(wpa_s);
> > + wpa_supplicant_cancel_scan(wpa_s);
> > + }
> > }
>
> wpa_supplicant_scan wouldn't do anything if you haven't got any enabled
> networks so the cancel_scan() is a bit moot. no ?
>
> Regarding sched scan, I think the more correct behavior is to restart sched
> scan whenever the enabled networks list change (e.g.
> enable/disable/remove)
> as otherwise we'd continue to sched scan a non relevant list of SSIDs.
> This would also take care of removing all networks given that we bail out in
> wpa_supplicant_req_sched_scan if there aren't any enabled networks.
> I have some internal patches on our tree doing something like this but they
> need some work to be rebased on the latetest master.
> If we agree that's a better approach I can rebase them and submit.
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
More information about the Hostap
mailing list