diff mbox series

[1/1] hostapd: Use attribute NL80211_ATTR_BSSID to trigger scan for specifc BSSID

Message ID b9baaae89edd92748912ad71c64321fc4966f878.1702039534.git.vinayak.yadawad@broadcom.com
State Accepted
Headers show
Series [1/1] hostapd: Use attribute NL80211_ATTR_BSSID to trigger scan for specifc BSSID | expand

Commit Message

Vinayak Yadawad Dec. 8, 2023, 4:20 p.m. UTC
With changes to optimize scan for specific BSSID, there arises a
scenario where in nl80211_trigger_scan is called with a scan
randomization enabled. A combination of NL80211_ATTR_MAC and
scan randomization results in invalid error for the scan request.
In order to fix the issue we use attribute NL80211_ATTR_BSSID
instead of NL80211_ATTR_MAC.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
---
 src/drivers/driver_nl80211_scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 9, 2023, 9:51 a.m. UTC | #1
On Fri, Dec 08, 2023 at 09:50:23PM +0530, Vinayak Yadawad wrote:
> With changes to optimize scan for specific BSSID, there arises a
> scenario where in nl80211_trigger_scan is called with a scan
> randomization enabled. A combination of NL80211_ATTR_MAC and
> scan randomization results in invalid error for the scan request.
> In order to fix the issue we use attribute NL80211_ATTR_BSSID
> instead of NL80211_ATTR_MAC.

Thanks, applied. Though, I left the NL80211_ATTR_MAC addition in place
for now for the cases where MAC address randomization is not used so
that wpa_supplicant remains compatible with older kernel versions that
did not yet support NL80211_ATTR_BSSID.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 736db6406..ebedb01c6 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -385,7 +385,7 @@  int wpa_driver_nl80211_scan(struct i802_bss *bss,
 	if (params->bssid) {
 		wpa_printf(MSG_DEBUG, "nl80211: Scan for a specific BSSID: "
 			   MACSTR, MAC2STR(params->bssid));
-		if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, params->bssid))
+		if (nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, params->bssid))
 			goto fail;
 	}