[PATCH] don't bring the interface down if WoWLAN is enabled

Dan Williams dcbw at redhat.com
Mon Mar 27 09:16:14 PDT 2017


On Mon, 2017-03-27 at 16:45 +0300, Jouni Malinen wrote:
> On Fri, Mar 17, 2017 at 03:27:45PM +0100, Matteo Croce wrote:
> > ---
> 
> Would need to have Signed-off-by: line in the commit log as described
> in
> the top level CONTRIBUTIONS file.. That said, based on the
> discussion,
> this did not sound like the best way of handling the issue.
> 
> > diff --git a/wpa_supplicant/wpa_supplicant.c
> > b/wpa_supplicant/wpa_supplicant.c
> > @@ -5386,7 +5386,12 @@ int wpa_supplicant_remove_iface(struct
> > wpa_global *global,
> >  		global->p2p_group_formation = NULL;
> >  	if (global->p2p_invite_group == wpa_s)
> >  		global->p2p_invite_group = NULL;
> > -	wpa_supplicant_deinit_iface(wpa_s, 1, terminate);
> > +
> > +	/* Don't bring the interface down if WoWLAN is enabled */
> > +	if (wpa_s->driver->get_wowlan && !wpa_s->driver-
> > >get_wowlan(wpa_s->drv_priv))
> > +		wpa_supplicant_deinit_iface(wpa_s, 1, terminate);
> > +	else
> > +		wpa_dbg(wpa_s, MSG_INFO, "Leaving up as WoWLAN is
> > enabled");
> 
> And this part looks pretty suspicious to me.. Wouldn't this leak
> memory
> and other resources by skipping all the deinit steps? How is the
> wpa_supplicant process supposed to recover from this? By getting
> killed
> and restarted by something external? That would not really be the way
> to
> handle this.. I'm not completely sure I understood what this is
> trying
> to do, but if a change in wpa_supplicant is needed, please describe
> the
> exact state on which the Wi-Fi device is supposed to be left and what
> will be the next operation to continue from that state.

I believe the issue is that the WiFi interface stays powered while the
system is actually shut down, and the WiFi should wake/start the system
up on magic packets or activity.  But of course, when stopping the
supplicant service during normal system shutdown paths, the supplicant
removes the iface and cleans it up, rendering WoWOL useless.

I'm actually thinking that the supplicant shouldn't be stopped cleanly
in this case at all, and I've got to believe that whatever is managing
system services (systemd? upstart? something else?) can differentiate
between "shut down and keep WOWLAN enabled" and "shut it all down". 
And maybe that thing should be deciding whether or not to stop the
supplicant or to just kill it.

Dan



More information about the Hostap mailing list