History

nl80211: Use different attrs for BSSID and random MAC addr in scan req

NL80211_ATTR_MAC was used to set both the specific BSSID to be scanned and the random MAC address to be used when privacy is enabled. When both the features are enabled, both the BSSID and the local MAC address were getting same value causing Probe Request frames to go with unintended DA. Hence, this has been fixed by using a different NL80211_ATTR_BSSID attribute to set the specific BSSID (which was the more recent addition in cfg80211) for a scan. Backwards compatibility with old userspace software is maintained to some extent by allowing NL80211_ATTR_MAC to be used to set the specific BSSID when scanning without enabling random MAC address use. Scanning with random source MAC address was introduced by commit ad2b26abc157 ("cfg80211: allow drivers to support random MAC addresses for scan") and the issue was introduced with the addition of the second user for the same attribute in commit 818965d39177 ("cfg80211: Allow a scan request for a specific BSSID").

Vamsi Krishna committed 9 years ago

Commit 2fa436b1 parent eeb04a92 files · +21 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+6−1
@@ -323,7 +323,7 @@ · 322 unmodified lines
323323 * @NL80211_CMD_GET_SCAN: get scan results
324324 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
325325 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
326− * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
326+ * probe requests at CCK rate or not. %NL80211_ATTR_BSSID can be used to
327327 * specify a BSSID to scan for; if not included, the wildcard BSSID will
328328 * be used.
329329 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
@@ -1977,6 +1977,9 @@ enum nl80211_commands { · 1647 unmodified lines
19771977 * @NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED: Indicates whether or not multicast
19781978 * packets should be send out as unicast to all stations (flag attribute).
19791979 *
1980+ * @NL80211_ATTR_BSSID: The BSSID of the AP. Note that %NL80211_ATTR_MAC is also
1981+ * used in various commands/events for specifying the BSSID.
1982+ *
19801983 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
19811984 * @NL80211_ATTR_MAX: highest attribute number currently defined
19821985 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2381,6 +2384,8 @@ enum nl80211_attrs { · 398 unmodified lines
23812384
23822385 NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED,
23832386
2387+ NL80211_ATTR_BSSID,
2388+
23842389 /* add attributes here, update the policy in nl80211.c */
23852390
23862391 __NL80211_ATTR_AFTER_LAST,