Bug 13506 - iwlagn tries to reconnect to unavailable wifi network after resume
Summary: iwlagn tries to reconnect to unavailable wifi network after resume
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-11 09:22 UTC by Jos Dehaes
Modified: 2010-06-07 19:43 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.30-rc
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Jos Dehaes 2009-06-11 09:22:14 UTC
When I'm at home, I connect to my home wifi. I suspend my machine (dell precision M4300, with intel 4965 card), and go to work. My wifi network is obviously not available there, but it tries to reconnect anyway, and network manager prompts me for a password. When I boot any older kernel like 2.6.29.4, this does not happen, so it's not a userspace issue. I have not yet tested with 2.6.30 final (but as that driver has not changed, I suspect it won't make a difference).

Any ideas what might cause this? I can compile/test patches.

Cheers,
Jos
Comment 1 Jos Dehaes 2009-06-11 09:23:51 UTC
If I cancel the reconnect at work, suspend there, and resume at home, it does no longer automatically connect to my home wifi when it is available. This also works perfectly with pre-2.6.30.
Comment 2 John W. Linville 2009-06-11 12:06:50 UTC
Sorry, but I've seen this behavior for forever.  I can't explain why you wouldn't observe it with an older kernel, but I'm fairly certain that is coincidence.

In any event, choosing what connection to make (or even to connect at all) is handled in userland.  I really don't think this is a kernel issue.
Comment 3 Jos Dehaes 2009-06-11 12:21:31 UTC
I agree that it seems a userspace problem, but I can reproduce at will: it works with pre-2.6.30 and doesn't with 2.6.30. I first noticed this in 2.6.30-rc3 or something. So something must have changed to trigger this.
Comment 4 John W. Linville 2009-06-11 12:29:39 UTC
Can you reproduce it without running NetworkManager or wpa_supplicant?  Of course, that limits you to WEP or open networks...
Comment 5 Jos Dehaes 2009-06-11 13:24:52 UTC
I'll try to reproduce with WEP.

I'm guessing 2.6.30 still shows my home network as available at resume or something, so network manager tries to connect to it (as it is a known network). Maybe the timing of the scanning changed? Or 2.6.29 and earlier clear the list of available networks at resume? (I don't know if this makes any technical sense ;-)).
Comment 6 John W. Linville 2009-06-11 13:34:29 UTC
Well the scenario makes sense, except that as I recall it was the earlier kernels that would hold onto old scan results through a resume.
Comment 7 Jos Dehaes 2009-06-11 13:40:17 UTC
Can you check in the code? Or add logging or something, so we can be sure?

Also, I'm reopening then :-).
Comment 8 John W. Linville 2009-06-11 14:04:38 UTC
Please recreate as requested...
Comment 9 John W. Linville 2009-06-11 14:52:07 UTC
Alright, so there is this:

commit 827b1fb44b7e41377a5498b9d070a11dfae2c283
Author: Johannes Berg <johannes@sipsolutions.net>
Date:   Fri Mar 13 11:44:18 2009 +0100

    mac80211: resume properly, add suspend/resume test
    
    When mac80211 resumes, it currently doesn't reconfigure the interfaces
    entirely and also doesn't reconfigure BSS information -- fix this.
    
    Also, to be able to test this, add a debugfs file that just calls
    the suspend/resume code to see what happens when we go through that,
    without needing the time-consuming suspend/resume cycle.
    
    (Original version broke the build for CONFIG_PM=n.  Define alternative
    functions for that situation. -- JWL)
    
    Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

I'm not sure if it is causing what you are seeing, and even if it is I'm not sure it is really a bug.  The alternative to reconfiguration would be to slow-down operations for the case of temporary suspend with resume in the same location (like during a meeting).

Anyway, I'll let Johannes comment from here...
Comment 10 Jos Dehaes 2009-06-11 16:25:35 UTC
I'm going to test 2.6.30 with this commit reverted.
Comment 11 Johannes Berg 2009-06-11 19:41:56 UTC
I don't think that commit is related.

When NM asks you for the password, please verify that

iw dev wlan0 scan dump

does show the BSS in question, or just paste the entire output here. I'm having similar issues where this command does _not_ show the BSS, and it's entirely a problem in userspace. I wouldn't rule out userspace because the older kernel works, might well be something changed in the timing or so, and the above command will give us certainty.
Comment 12 Jos Dehaes 2009-06-11 21:11:59 UTC
that command show me the usage... Did you mean 

iw dev wlan0 station dump

?
Comment 13 Johannes Berg 2009-06-11 21:29:08 UTC
No, I do mean "iw dev wlan0 scan dump", which should work unless your iw is pretty old, in which case "/sbin/iwlist wlan0 scan last" will do.
Comment 14 Jos Dehaes 2009-06-12 09:11:22 UTC
My iw is 0.9.9 (ubuntu jaunty). I confirm reverting that commit does not solve the problem. 

The ESSID NM is connecting to is "OpenWRT", it does not show up in the scan.

So we now have a situation where NM no longer works correctly with current kernel. Any ideas?

The result of the command:

jos@roxy gateway$ iwlist wlan0 scan last
wlan0     Scan completed :
          Cell 01 - Address: 00:23:69:6D:D2:BE
                    Channel:4
                    Frequency:2.427 GHz (Channel 4)
                    Quality=32/70  Signal level=-78 dBm  
                    Encryption key:on
                    ESSID:"PEBBLEMEDIA"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000afcab3e177
                    Extra: Last beacon: 4471ms ago
                    IE: Unknown: 000B504542424C454D45444941
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030104
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 0406000200000000
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: 2D1A6E1803FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1604050000000000000000000000000000000000000000
                    IE: Unknown: DD1E00904C336E1C03FFFF000000000000000000000000000000000000000000
                    IE: Unknown: DD1A00904C3404050000000000000000000000000000000000000000
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
          Cell 02 - Address: 00:23:69:6D:CF:36
                    Channel:4
                    Frequency:2.427 GHz (Channel 4)
                    Quality=37/70  Signal level=-73 dBm  
                    Encryption key:on
                    ESSID:"PEBBLEMEDIA"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000afad214cb8
                    Extra: Last beacon: 4439ms ago
                    IE: Unknown: 000B504542424C454D45444941
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030104
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 0406000200000000
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: 2D1A6E1803FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1604050000000000000000000000000000000000000000
                    IE: Unknown: DD1E00904C336E1C03FFFF000000000000000000000000000000000000000000
                    IE: Unknown: DD1A00904C3404050000000000000000000000000000000000000000
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
          Cell 03 - Address: C6:47:C2:79:DC:94
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=23/70  Signal level=-87 dBm  
                    Encryption key:off
                    ESSID:"linksys1"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Mode:Ad-Hoc
                    Extra:tsf=00000002222931b8
                    Extra: Last beacon: 4178ms ago
                    IE: Unknown: 00086C696E6B73797331
                    IE: Unknown: 010482848B96
                    IE: Unknown: 03010B
                    IE: Unknown: 06020000
                    IE: Unknown: DD09001018020010010000
          Cell 04 - Address: 00:1F:9E:27:E6:80
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=22/70  Signal level=-88 dBm  
                    Encryption key:off
                    ESSID:"CKP_Guest"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000005dad418c
                    Extra: Last beacon: 3969ms ago
                    IE: Unknown: 0009434B505F4775657374
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 03010B
                    IE: Unknown: 0706444520010D17
                    IE: Unknown: 2A0102
                    IE: Unknown: 32043048606C
                    IE: Unknown: 9606004096000E00
                    IE: Unknown: DD06004096010104
                    IE: Unknown: DD050040960305
                    IE: Unknown: DD050040960B09
                    IE: Unknown: DD050040961400
          Cell 05 - Address: 00:1F:9E:27:E6:83
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=19/70  Signal level=-91 dBm  
                    Encryption key:on
                    ESSID:"CKP_Secure"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000005daaaa35
                    Extra: Last beacon: 4213ms ago
                    IE: Unknown: 000A434B505F536563757265
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 03010B
                    IE: Unknown: 0706444520010D17
                    IE: Unknown: 2A0102
                    IE: Unknown: 32043048606C
                    IE: Unknown: 9606004096000E00
                    IE: Unknown: DD06004096010104
                    IE: Unknown: DD050040960305
                    IE: Unknown: DD050040960B09
                    IE: Unknown: DD050040961400
          Cell 06 - Address: 00:1F:9E:27:E6:81
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=27/70  Signal level=-83 dBm  
                    Encryption key:on
                    ESSID:""
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000005dabb190
                    Extra: Last beacon: 4121ms ago
                    IE: Unknown: 000100
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 03010B
                    IE: Unknown: 050400010000
                    IE: Unknown: 0706444520010D17
                    IE: Unknown: 2A0102
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32043048606C
                    IE: Unknown: 9606004096000E00
                    IE: Unknown: DD06004096010104
                    IE: Unknown: DD050040960305
                    IE: Unknown: DD050040960B09
                    IE: Unknown: DD050040961401
          Cell 07 - Address: 12:33:CF:0C:A9:2C
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=21/70  Signal level=-89 dBm  
                    Encryption key:off
                    ESSID:"WLAN-PS"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Mode:Ad-Hoc
                    Extra:tsf=0000000224e8a1f8
                    Extra: Last beacon: 4206ms ago
                    IE: Unknown: 0007574C414E2D5053
                    IE: Unknown: 010482848B96
                    IE: Unknown: 03010B
                    IE: Unknown: 06020000
                    IE: Unknown: DD09001018020010010000
          Cell 08 - Address: 02:1B:77:00:00:F0
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=27/70  Signal level=-83 dBm  
                    Encryption key:off
                    ESSID:"olympus1024"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Ad-Hoc
                    Extra:tsf=0000000314cd99df
                    Extra: Last beacon: 4568ms ago
                    IE: Unknown: 000B6F6C796D70757331303234
                    IE: Unknown: 010482840B16
                    IE: Unknown: 030101
                    IE: Unknown: 06020000
                    IE: Unknown: 2A0100
                    IE: Unknown: 32080C1218243048606C
                    IE: Unknown: DD070050F202000100
          Cell 09 - Address: 76:A8:47:18:FD:B1
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=21/70  Signal level=-89 dBm  
                    Encryption key:off
                    ESSID:"Free Public WiFi"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Ad-Hoc
                    Extra:tsf=000000025a9c4a35
                    Extra: Last beacon: 4193ms ago
                    IE: Unknown: 001046726565205075626C69632057694669
                    IE: Unknown: 010482848B96
                    IE: Unknown: 03010B
                    IE: Unknown: 06020000
                    IE: Unknown: 2A0107
                    IE: Unknown: 32080C1218243048606C
                    IE: Unknown: DD070050F202000100
          Cell 10 - Address: 02:1B:77:00:00:3F
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=32/70  Signal level=-78 dBm  
                    Encryption key:off
                    ESSID:"Free Public WiFi"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Ad-Hoc
                    Extra:tsf=00000000279892b1
                    Extra: Last beacon: 4486ms ago
                    IE: Unknown: 001046726565205075626C69632057694669
                    IE: Unknown: 010482840B16
                    IE: Unknown: 030101
                    IE: Unknown: 06020000
                    IE: Unknown: DD070050F202000100
                    IE: Unknown: 2A0100
                    IE: Unknown: 32080C1218243048606C
          Cell 11 - Address: 00:07:40:F1:B8:28
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=22/70  Signal level=-88 dBm  
                    Encryption key:on
                    ESSID:"Arch-Agora-Wireless"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000030b505063c7
                    Extra: Last beacon: 4550ms ago
                    IE: Unknown: 0013417263682D41676F72612D576972656C657373
                    IE: Unknown: 010482848B96
                    IE: Unknown: 030101
                    IE: Unknown: 2A0107
                    IE: Unknown: 2F0107
                    IE: Unknown: 32080C1218243048606C
                    IE: Unknown: DD05001018010A
          Cell 12 - Address: 00:0E:A6:F0:35:CD
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=37/70  Signal level=-73 dBm  
                    Encryption key:on
                    ESSID:"Dela"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=00001b1be2ebd075
                    Extra: Last beacon: 4387ms ago
                    IE: Unknown: 000444656C61
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 030106
                    IE: Unknown: 2A0104
                    IE: Unknown: 2F0104
                    IE: Unknown: 32040C121860
                    IE: Unknown: DD050010180102
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK

jos@roxy gateway$
Comment 15 Johannes Berg 2009-06-12 12:30:40 UTC
So, to recap, you're connected to "OpenWRT" at home, then suspend, resume at work and NM tries to connect to "OpenWRT" even though that is no longer in the scan results.

I'll ask Dan to look at this.
Comment 16 Jos Dehaes 2009-06-12 12:36:50 UTC
You are correct. And with pre-2.6.30 kernels, this does not happen.

I have opened a NM bug also:

http://bugzilla.gnome.org/show_bug.cgi?id=585540
Comment 17 John W. Linville 2010-03-05 18:50:40 UTC
I'm still not convinced this is ultimately a kernel problem, especially if your testing above showed that the AP in question was _not_ in the scan results after resume.  At any rate, are you experiencing this issue with 2.6.33?
Comment 18 John W. Linville 2010-06-07 19:43:00 UTC
Closed due to lack of response...

Note You need to log in before you can comment on or make changes to this bug.