2009-09-18 12:19:12

by Holger Schurig

[permalink] [raw]
Subject: Life-time of scan-results?

While changing an AP between different SSIDs and encryptions, I
get from time to time this scan result back:

1253272186.504636: ##HS 0: 00:1b:d4:44:35:90 ssid='MNWPA' freq=2412
1253272186.504655: ##HS 1: 00:1b:53:11:dc:40 ssid='MNFUNK' freq=2412
1253272186.504672: ##HS 2: 00:13:19:80:da:30 ssid='XXXXX' freq=2412
1253272186.504688: ##HS 3: 00:13:19:80:da:30 ssid='MNHS' freq=2412


How can I entirely clear the scan results inside cfg80211/mac80211
from user-space?

Again this doesn't fit to any probe-responses.

--
http://www.holgerschurig.de


2009-09-18 14:13:32

by Holger Schurig

[permalink] [raw]
Subject: Re: Life-time of scan-results?

Currently, before returning scan results, cfg80211_bss_expire()
get's called. It deletes BSSs that are older than
IEEE80211_SCAN_RESULT_EXPIRE.



I propose to change cfg80211_bss_expire() so that it doesn't
hard-code NL80211_CMD_TRIGGER_SCAN anymore, but has a new
parameter, say "int expire".



Then NL80211_CMD_TRIGGER_SCAN get's a new optional attribute, say
NL80211_ATTR_SCAN_EXPIRE.

If that attribut exists when calling NL80211_CMD_TRIGGER_SCAN,
it's value will be used to call cfg80211_bss_expire(). If the
value is zero, cfg80211_bss_expire() triggers the whole
rdev->bss_list. That means we do a completely fresh scan.

If it doesn't exists, cfg80211_bss_expire() won't be called at
scan-trigger time.




NL80211_CMD_GET_SCAN could get this attribute as well. If
not specified, then the default of NL80211_CMD_TRIGGER_SCAN will
be used. That is, just right now, the rdev->bss_list will expire
like now.

However, if a value will be specified, then the bss_list will be
expired with the specified expiry time.

Specifying zero doesn't make sense here, because that would zap
the freshly made bss list. So a zero could mean "Don't expire
anything".


That way user-space could ask for what has scanned the last time,
even when this has been one hour ago --- with no scans in the
meantime.


Does this make sense?

--
http://www.holgerschurig.de

2009-09-18 13:08:42

by Holger Schurig

[permalink] [raw]
Subject: Re: Life-time of scan-results?

Here's a log of the events with some kernel msgs.

First, a successfull association:

##HS nl80211_trigger_scan:2922
##HS ieee80211_scan_rx:150 mac 00:1b:53:11:dc:40, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:53:11:dc:40, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:13:19:80:da:30, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:d4:44:35:90, probe resp 0
eth1: direct probe to AP 00:13:19:80:da:30 (try 1)
eth1 direct probe responded
eth1: authenticate with AP 00:13:19:80:da:30 (try 1)
eth1: authenticated
eth1: associate with AP 00:13:19:80:da:30 (try 1)
eth1: RX AssocResp from 00:13:19:80:da:30 (capab=0x11 status=0 aid=53)
eth1: associated

And here the user-space view:

1253275071.933750: wpa_driver_nl80211_scan:1570
1253275071.934167: NL80211_CMD_TRIGGER_SCAN
1253275072.454547: NL80211_CMD_NEW_SCAN_RESULTS
1253275072.454652: Received scan results (3 BSSes)
1253275072.454670: ##HS 0: 00:1b:53:11:dc:40 ssid='MNFUNK' freq=2412
1253275072.454689: ##HS 1: 00:1b:d4:44:35:90 ssid='MNWPA' freq=2412
1253275072.454706: ##HS 2: 00:13:19:80:da:30 ssid='MNHS' freq=2412
1253275072.454728: CTRL-EVENT-SCAN-RESULTS
1253275072.454791: Trying to authenticate with 00:13:19:80:da:30 (SSID='MNHS' freq=2412 MHz)
1253275072.704223: NL80211_CMD_AUTHENTICATE
1253275072.704244: MLME event NL80211_CMD_AUTHENTICATE
1253275072.704267: Trying to associate with 00:13:19:80:da:30 (SSID='MNHS' freq=2412 MHz)
1253275072.762116: NL80211_CMD_ASSOCIATE
1253275072.762136: MLME event NL80211_CMD_ASSOCIATE
1253275072.762175: Associated with 00:13:19:80:da:30
1253275072.767178: NL80211_CMD_CONNECT
1253275072.880891: WPA: Key negotiation completed with 00:13:19:80:da:30 [PTK=TKIP GTK=TKIP]
1253275072.880931: CTRL-EVENT-CONNECTED - Connection to 00:13:19:80:da:30 completed (auth) [id=0 id_str=]




Now I take away the AP:

eth1: deauthenticated from 00:13:19:80:da:30 (Reason: 1)
##HS nl80211_trigger_scan:2922
##HS ieee80211_scan_rx:150 mac 00:1b:53:11:dc:40, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:d4:44:35:90, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:d4:44:35:90, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:53:11:dc:40, probe resp 0
##HS ieee80211_scan_rx:150 mac 00:1b:d4:44:35:90, probe resp 0

Note: there was no beacon nor probe-response from
00:13:19:80:da:30.

253275108.483431: NL80211_CMD_DEAUTHENTICATE
1253275108.483451: MLME event NL80211_CMD_DEAUTHENTICATE
1253275108.483464: ##HS wpa_supplicant_event_disassoc:1040
1253275108.483490: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
1253275108.483857: wpa_driver_nl80211_scan:1570
1253275108.484063: NL80211_CMD_DISCONNECT
1253275108.484106: NL80211_CMD_TRIGGER_SCAN
1253275108.958527: NL80211_CMD_NEW_SCAN_RESULTS
1253275108.958624: Received scan results (3 BSSes)
1253275108.958642: ##HS 0: 00:1b:53:11:dc:40 ssid='MNFUNK' freq=2412
1253275108.958661: ##HS 1: 00:1b:d4:44:35:90 ssid='MNWPA' freq=2412
1253275108.958677: ##HS 2: 00:13:19:80:da:30 ssid='MNHS' freq=2412


But here it was in the results. And because of that,
wpa_supplicant tries to use this AP in vain:

1253275108.958746: Trying to authenticate with 00:13:19:80:da:30 (SSID='MNHS' freq=2412 MHz)
1253275109.722468: NL80211_CMD_AUTHENTICATE
...

--
http://www.holgerschurig.de