From 2ec3dc702bd637be25a54546dd8d22a108311132 Mon Sep 17 00:00:00 2001 From: Harshitha Prem Date: Fri, 15 Dec 2023 15:43:54 +0530 Subject: [PATCH] hostapd: update bssid param for scan command In case of single netdev architecture, when we configure multi-link virtual ap interface, say 2 GHz + 5 GHz combination, the interface starts without synchronization. In this case, first 2 GHz link configuration is initiated first and started with say mac address X, then 5 GHz link configuration is initiated but since it has subset of 40 MHz, 40 MHz scan is triggered from hostapd. Driver uses same address X for 5G link scan which is causing same mac address clashes. This can be avoided by leveraging the existing bssid param used in scan command. hence, add changes to update bssid param in scan command Signed-off-by: Harshitha Prem --- src/ap/acs.c | 6 ++++++ src/ap/hw_features.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/ap/acs.c b/src/ap/acs.c index 443ef46..042fa2f 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -1485,6 +1485,12 @@ static int acs_request_scan(struct hostapd_iface *iface) iface->acs_num_completed_scans + 1, iface->conf->acs_num_scans); + if (iface->num_multi_hws) { + params.bssid = iface->bss[0]->conf->bssid; + wpa_printf(MSG_DEBUG, "scan triggered with bssid" MACSTR "\n", + MAC2STR(params.bssid)); + } + ret = hostapd_driver_scan(iface->bss[0], ¶ms); os_free(params.freqs); diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 062468b..c82324b 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -510,6 +510,12 @@ static void ap_ht40_scan_retry(void *eloop_data, void *user_data) else ieee80211n_scan_channels_5g(iface, ¶ms); + if (iface->num_multi_hws) { + params.bssid = iface->bss[0]->conf->bssid; + wpa_printf(MSG_DEBUG, "HT40 scan triggered with bssid" MACSTR "\n", + MAC2STR(params.bssid)); + } + ret = hostapd_driver_scan(iface->bss[0], ¶ms); iface->num_ht40_scan_tries++; os_free(params.freqs); @@ -561,6 +567,12 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface) else ieee80211n_scan_channels_5g(iface, ¶ms); + if (iface->num_multi_hws) { + params.bssid = iface->bss[0]->conf->bssid; + wpa_printf(MSG_DEBUG, "scan triggered with bssid" MACSTR "\n", + MAC2STR(params.bssid)); + } + ret = hostapd_driver_scan(iface->bss[0], ¶ms); os_free(params.freqs); -- 2.17.1