Can connect, but not reconnect, to WPA2 network

Jouni Malinen j at w1.fi
Wed Jun 18 13:29:56 EDT 2008


On Wed, Jun 18, 2008 at 11:58:48AM -0500, Todd Pytel wrote:

> I posted about the problem below to the Network Manager list, and one
> responder suggested that the problem may be related to wpa_supplicant
> and/or my wireless driver. I'm not so sure, but I would appreciate any
> help in, at least, generating better debug info and narrowing down where
> the problem is. One difficulty I'm having in producing useful debugging
> information is that I only see this problem when using Network Manager -
> running wpa_supplicant at the command line works fine.

If the connection works when running wpa_supplicant manually, but not
when trying to do the same through NM, I would usually expect the issue
to be closer to NM than wpa_supplicant/driver..

> However, when
> using Network Manager I don't know how to capture any debug output from
> wpa_supplicant (as opposed to running wpa_supplicant directly in the
> foreground). If someone could at least help me track down enough
> information to figure out who the relevant devs are, I would
> tremendously appreciate it. 

I'm not very familiar with NM, but I believe it can be configured to
store wpa_supplicant debug output somehow.. This would be more of a
question for the NM list, but maybe someone more familiar with NM can
answer this here, too.

> When I set up the connection "from scratch" (entering the key,
> specifying the security settings, etc. in the Network Manager GUI)
> everything works fine. I associate, DHCP fires up, all is good. However,
> once the connection is brought down (say, by disabling wireless through
> the nm-applet) I cannot reassociate without going through the initial
> configuration all over again. There appears to be some kind of key
> problem going on.

Based on quick browse through the log, I would agree with this
assumption.

> I'm including the output of /var/log/messages below
> for each case. The sticking point appears to be this step:
> 
> NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 psk <key>' 
> 
> In the first case (starting from scratch), this returns OK. When
> attempting to reconnect, it returns FAIL.

This looks like an internal issue for NetworkManager assuming I read the
log correctly. There's one interesting difference before this:

In the successful case:

> Jun 17 20:05:23 hector NetworkManager: <info>  Activation
> (wlan0_rename/wireless): access point 'SOPHROSUNE' is encrypted, and a
> key exists.  No new key needed. 

In the failed reconnect:

> Jun 17 20:07:35 hector NetworkManager: <info>  Activation
> (wlan0_rename/wireless): access point 'SOPHROSUNE' is encrypted, but NO
> valid key exists.  New key needed. 

However, this is follow by

> Jun 17 20:07:35 hector NetworkManager: <info>  Activation
> (wlan0_rename/wireless): access point 'SOPHROSUNE' is encrypted, and a
> key exists.  No new key needed. 

Anyway, after this, NM fails to set the PSK to wpa_supplicant:

> Jun 17 20:07:36 hector NetworkManager: <info>  SUP: sending command
> 'SET_NETWORK 0 psk <key>' 
> Jun 17 20:07:36 hector NetworkManager: <info>  SUP: response was 'FAIL' 

Since the debug log here does not include the exact command used here, I
don't know what exactly is triggering this failure, but I can only
assume that NM is trying to set an invalid PSK here.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list