mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
nl80211: Treat RSSI as part of each sched scan matchset
The original RSSI filter semantics for scheduled scan were really confusing - a separate matchset was created, but it wasn't actually treated as a separate matchset in the kernel but rather used as the global RSSI value. The RSSI matchset thus behaved like an RSSI filter outside of the matchsets, being ANDed rather than ORed (as normal between matchsets.) To make this less confusing, I changed the kernel API a bit to actually treat the RSSI inside each matchset properly, but keeping it compatible with the old approach by using a matchset with only an RSSI value as the default for all the other matchsets, and adding it as a separate matchset only if it's the only one. The proper way for wpa_supplicant to do this then would be to add the RSSI to each SSID matchset, and only add another matchset without SSID if there's none with. However, to keep compatibility with older kernels, always keep the non-SSID matchset and only add the RSSI to all the other matchsets. This gets close to the desired behaviour, the only difference would be that we shouldn't add the RSSI matchset if there are others, but stays compatible with old and new kernels, as new ones ignore the RSSI-only matchset if there are others and those others have an RSSI. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
04c366cb1d
commit
ff5e1d14af
@ -4995,10 +4995,20 @@ static int wpa_driver_nl80211_sched_scan(void *priv,
|
||||
NLA_PUT(msg, NL80211_ATTR_SCHED_SCAN_MATCH_SSID,
|
||||
drv->filter_ssids[i].ssid_len,
|
||||
drv->filter_ssids[i].ssid);
|
||||
if (params->filter_rssi)
|
||||
NLA_PUT_U32(msg,
|
||||
NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
|
||||
params->filter_rssi);
|
||||
|
||||
nla_nest_end(msg, match_set_ssid);
|
||||
}
|
||||
|
||||
/*
|
||||
* Due to backward compatibility code, newer kernels treat this
|
||||
* matchset (with only an RSSI filter) as the default for all
|
||||
* other matchsets, unless it's the only one, in which case the
|
||||
* matchset will actually allow all SSIDs above the RSSI.
|
||||
*/
|
||||
if (params->filter_rssi) {
|
||||
struct nlattr *match_set_rssi;
|
||||
match_set_rssi = nla_nest_start(msg, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user