Re: dhclient and wpa_supplicant

From: Sam Leffler <sam_at_errno.com>
Date: Sun, 31 Jul 2005 11:31:58 -0700
Stijn Hoop wrote:
> Hi,
> 
> On Fri, Jul 29, 2005 at 06:08:53PM -0700, Sam Leffler wrote:
> 
>>I just ran tests with wpa_supplicant and found that it does appear to 
>>handle open ap's properly.
> 
> 
> I cannot get this to work, using 2 different MiniPCI cards and
> a Linksys WRT54G, on a 7-CURRENT from yesterday.
> 
> The cards:
> 
> - an Intel Pro Wireless 2200B/G (model WM3A2200BG, Dell branded) using iwi
> - a Dell Truemobile 1300 WLAN (bcm4306) using ndis
> 
> For details, log files, etc, see
> 
> http://sandcat.nl/~stijn/freebsd/20050731-wlan/
> 

Sigh, well for iwi you do say:

"Maybe the problem is not with wpa_supplicant though; I cannot get 
if_iwi to associate by using ifconfig manually either."

Er, yeah, if you cannot associate w/o wpa_supplicant I'm not sure why 
you'd think it'd be more capable? (unless you're using wpa)  The log shows:

Jul 31 11:04:17 pounce kernel: iwi0: 	macaddr          bssid 
chan  rssi rate flag  wep  essid
Jul 31 11:04:17 pounce kernel: - 00:50:fc:d6:85:82 00:50:fc:d6:85:82 
11    38 11M   ess   no  "default"!

which means you found one ap w/ an ssid of "default" and it was rejected 
because you configured the device for a different ssid.  However I see 
probe resp frames from LZ111 in your log but it's never added to the 
scan list for some reason.  Seems like someone with iwi devices should 
investigate.

The ndis driver shows nothing in the log that indicates it hooks up 
properly to the net80211 layer so wpa_supplicant is unlikely to work 
with it.  Unfortunately there are many drivers that bypass the net80211 
layer causing applications written to the common api to not work.  OTOH 
your dhclient.conf file is so trivial that I'm not surprised it works; 
you could just as well have used:

ifconfig_ndis0="ssid LZ111 DHCP"

The issue with dhclient using dhclient.conf to set wireless parameters 
is that it does so, then sends it's DHCP protocol msg, then waits a 
fixed amount of time for a response from a DHCP server.  This is prone 
to fail as different configurations take different amounts of time to 
complete the scan+associate work.  Also dhclient (now) processes link 
state and assoc/reassoc/disassoc msgs which confuses this approach.  I 
did some changes to have it ignore these messages while setting the 
media parameters but it was complicated and still routinely failed 
because the timeouts were too small.  In the end I concluded that it 
wasn't worth supporting this mechanism any more; that wpa_supplicant is 
the better approach since it will scan ONCE and then select the 
appropriate network (while dhclient had to scan once for each possible 
network).  In general I have advocated that dhclient do less; in this 
case I want dhclient to let someone else setup the wireless networking 
parameters and have it do just the dhcp protocol.  The fact that 
dhclient messes with media parameters for an interface is more a 
byproduct of configuring wired networks (and not having better tools to 
configure wireless networks).

wpa_supplicant depends on a couple features in the net80211 layer to 
work properly: manual roaming (forcing the driver to not automtically do 
things like associate after scanning so it can instead decide which ap 
to use), scan (scan for ap's and report results), and associate to a 
particular ap (as identified in the scan results).  Past that it uses 
the common ioctl's defined to set keys and other parameters that you 
normally get to via ifconfig.  For wpa and 802.1x is needs some more 
stuff.  Drivers that bypass the net80211 layer for some or all of this 
stuff may not work correctly and should be fixed.

> Happy to do more digging / prodding if directed -- I'm totally out of
> my league when debugging wireless stuff, I just wanted it to work :-)
> 
> --Stijn
> 
Received on Sun Jul 31 2005 - 16:26:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:40 UTC