[PATCH] driver_wext.c: Make sure that interface is UP

Dan Williams dcbw
Mon Dec 7 22:56:29 PST 2009


On Mon, 2009-12-07 at 14:25 -0800, Dmitry Shmidt wrote:
> Hi Jouni,
> 
> You are right in general. But there are several scenarios where it is
> just easier to control interface
> from the wpa_supplicant driver layer itself.
> For example, you've associated, connected and got IP by dhcp client.
> You were disassociated, lost connection and network manager turned off

I'll assume by "network manager" you mean any connection manager that's
in use.

> interface to prevent trying to access it.
> Then you are trying to reassociate and key exchange will fail.

When the device is down, the wlan interface is allowed to go into
aggressive power-save mode.  So expecting that the device is anywhere
near ready to associate at this point if it was previously down is
incorrect.

Whenever the wlan device is to be used, it should be UP.  If you're
concerned about not allowing access to the device, either (a) don't give
it an IP address, or (b) stop your TX and RX queues when you're not
associated, which you should be doing anyway.

> My point is that relying on network manager to keep interface in
> proper state may cause wpa_supplicant to
> fail to complete association.

Why is that relevant?  The device should always be IFF_UP unless it's
been rfkilled or put into aggressive power-save mode.  wpa_supplicant
doesn't have much to do with that.  The supplicant expects that the
device is available to it whenever the interface has been added to the
supplicant.  When the device is unusable, remove the device from the
supplicant.  When the device is usable again, add the device to the
supplicant.

Dan

> On Mon, Dec 7, 2009 at 1:59 PM, Jouni Malinen <j at w1.fi> wrote:
> > On Mon, Dec 07, 2009 at 01:04:44PM -0800, Dmitry Shmidt wrote:
> >
> >> After association in case of key handshake we need to send packets and
> >> we want xmit queue to be ON.
> >> And sometimes it is possible that interface was turned OFF.
> >
> > What would set the interface down? And if it is down and the driver has
> > disabled the radio, how would we even get here (e.g., scan results may
> > not be available)? Since wpa_supplicant sets the interface UP in the
> > start, this patch looks like a workaround for something that should
> > probably be fixed at the location of the real problems (i.e., make it
> > not set the interface down).
> >
> > --
> > Jouni Malinen                                            PGP id EFC895FA
> > _______________________________________________
> > HostAP mailing list
> > HostAP at lists.shmoo.com
> > http://lists.shmoo.com/mailman/listinfo/hostap
> >
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap




More information about the Hostap mailing list