WPA-PSK won't exchange keys using interface - wifi0

Tony Espy espy at pepper.com
Tue Jul 5 18:50:42 EDT 2005


Jouni Malinen wrote:
> On Tue, Jul 05, 2005 at 01:20:17PM -0400, Tony Espy wrote:
> 
>>i've run into a problem where i can't seem to get wpa_supplicant to 
>>complete it's key exchange with an AP using WPA-PSK over the wifi0 
>>interface.  it works just fine if i specify wlan0 as the interface.
> 
> Using wifi0 interface for this is not supported, nor expected to work.

Is there anyway around this?  I posted a question on 03/28 re: using 
this sort of configuration, and from your response, it sounded like this 
wouldn't be a problem ( note -- I've attached your original reply ).

In fact, association with open or WEP access points work just fine using 
this configuration.

In my email, I didn't explicitly call out the fact that we were using 
wpa_supplicant, so that may have been my bad.

>>we switched awhile back to using wifi0 for configuration of wifi ( ie. 
>>we start wpa_supplicant with '-iwifi0' ), and then use wlan0 as our main 
>>IP interface.  this allows our DHCP client (pump) to mark wlan0 UP or 
>>DOWN without interferring with the normal operation of the HostAP driver.
> 
> It sounds like you are trying to solve an issue with a workaround in the
> driver and not by making the DHCP client act more sanely.

My assumption was that the UP/DOWN flag could be used to indicate to the 
rest of the system that an interface was "online/offline" ( ie. 
available for IP traffic ).  Apparently the authors of pump made this 
same assumption.

Seems like there's some varying opinions on what ifconfig's up/down 
flags mean.  The Linux Network Admin Guide for example, states that the 
  UP/DOWN flags indicate whether or not the interface is accessible to 
the IP layer.   A few other manpages for various Unix systems also seem 
to convey the same usage ( AIX, Darwin / OS X ).

The manpage for 'ifconfig' on my desktop system ( Fedora C4 ) however 
states that the 'down' flag causes the driver for the interface to be 
shutdown, which is what HostAP does.

Note -- however that the ethernet driver doesn't behave that way. 
'eth0' can be marked down, but will still allow DHCP messages to be 
broadcast.

If there's another way to mark an interface usable to the rest of the 
system, I'm not aware of it.  Without the use of the UP/DOWN flag, one 
would have to resort to setting the IP address to a known un-usable 
address ( eg. all '0's or '4's like the Prism FW does with BSSIDs ).

So it seems like I made a bad decision based upon your previous reply.

Would it be possible to modify the driver to allow key exchange to occur 
even though the interface was marked down?

If not, any advice beyond my previous hack of assigning all '0's or '4's 
as the IP address?

Thanks,
Tony Espy
Pepper Computer

---------------------------------------------------------------------------------
Reply from you to my Post -- 04/03/2005:

 >> One of the first things I ran into was that when killed, pump marked 
 >> the interface as DOWN.  Since HostAP requires one or more of it's
 >> device(s) to be UP in order function, I had to run some extra code 
to >> make sure "wlan0" was marked UP before associating with a new AP.
 >>
 >> It also seems to me that the right way to handle changing IP
 >> addresses, is to mark the interface DOWN, muck with the IP
 >> parameters, then mark the interface UP.

I don't see why this would be necessary for IP parameters, but yes, many
DHCP clients do it.

 >> So, I came up with the idea of using both HostAP devices; "wifi0" for
 >> association, and "wlan0" as my actual IP interface.  This allows
 >> toggling of "wlan0"'s UP/DOWN flag ( by pump, or other code ) without
 >> disabling the HostAP driver as "wifi0" remains UP and thus
 >> wpa_supplicant is free to do it's thing.

In order to allow users to completely ignore wifi0, Host AP driver
sets it UP automatically when needed. If this has happened, it will also
be set DOWN automatically when the other interface is being set DOWN. If
wifi0 is set UP manually, the driver does not set it down automatically.
In other wrods, what you describe here is indeed expected behavior and
one way of making sure the driver keeps the wlan card operational all
the time.

 >> Am I correct to be using both HostAP devices in such a manner while 
 >> in managed (STA) mode?

Yes, it is ok to set wifi0 UP manually in any mode.











More information about the HostAP mailing list