]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
scan: Pass correct link ID in all cases
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Sat, 7 Sep 2024 04:08:00 +0000 (09:38 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 2 Oct 2024 21:38:56 +0000 (00:38 +0300)
In hostapd, when a scan was initiated, the link ID parameter was not
populated in all scenarios, such as ACS. Additionally, each caller of
hostapd_driver_scan() provided the link ID. However, since
hostapd_driver_scan() has access to the hapd pointer, it can populate
the link ID itself.

And from wpa_supplicant, link ID was passed as 0 which does not seem to
be correct. Fix that as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/ap_drv_ops.c
src/ap/hw_features.c
wpa_supplicant/driver_i.h

index 9776109270cbc86a88e1b0e21646814066df99e5..f82bfd077ca371c303a997bdfdc1f7df6cadb3a3 100644 (file)
@@ -781,6 +781,12 @@ bool hostapd_drv_nl80211(struct hostapd_data *hapd)
 int hostapd_driver_scan(struct hostapd_data *hapd,
                        struct wpa_driver_scan_params *params)
 {
+       params->link_id = -1;
+#ifdef CONFIG_IEEE80211BE
+       if (hapd->conf->mld_ap)
+               params->link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+
        if (hapd->driver && hapd->driver->scan2)
                return hapd->driver->scan2(hapd->drv_priv, params);
        return -1;
index 02d67593a370355a90900cfd6910cc8b7d09c980..cef38173efa2b2f1412b44bfc83336cc8be3f80b 100644 (file)
@@ -528,12 +528,6 @@ static void ap_ht40_scan_retry(void *eloop_data, void *user_data)
        else
                ieee80211n_scan_channels_5g(iface, &params);
 
-       params.link_id = -1;
-#ifdef CONFIG_IEEE80211BE
-       if (iface->bss[0]->conf->mld_ap)
-               params.link_id = iface->bss[0]->mld_link_id;
-#endif /* CONFIG_IEEE80211BE */
-
        ret = hostapd_driver_scan(iface->bss[0], &params);
        iface->num_ht40_scan_tries++;
        os_free(params.freqs);
@@ -585,11 +579,6 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
        else
                ieee80211n_scan_channels_5g(iface, &params);
 
-       params.link_id = -1;
-#ifdef CONFIG_IEEE80211BE
-       if (iface->bss[0]->conf->mld_ap)
-               params.link_id = iface->bss[0]->mld_link_id;
-#endif /* CONFIG_IEEE80211BE */
        ret = hostapd_driver_scan(iface->bss[0], &params);
        os_free(params.freqs);
 
index b6c7f50857afbb239f75aeb1c8a282beec497eb5..cd74e31d34abf5747533538a3ae9b95b75755b7f 100644 (file)
@@ -104,6 +104,8 @@ static inline int wpa_drv_mesh_link_probe(struct wpa_supplicant *wpa_s,
 static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s,
                               struct wpa_driver_scan_params *params)
 {
+       params->link_id = -1;
+
 #ifdef CONFIG_TESTING_OPTIONS
        if (wpa_s->test_failure == WPAS_TEST_FAILURE_SCAN_TRIGGER)
                return -EBUSY;