]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Set bss flink frequency for non-ML AP BSS
authorRameshkumar Sundaram <quic_ramess@quicinc.com>
Tue, 18 Mar 2025 10:07:14 +0000 (15:37 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 18 Mar 2025 20:07:28 +0000 (22:07 +0200)
Currently nl80211 BSSs (struct i802_bss) flink->freq is initialized to
drv->first_bss->flink->freq in wpa_driver_nl80211_if_add(). In case of
single drv model, this results in frequency of the first BSS of the
first radio (say, on the 2.4 GHz band) being set to all the BSSs of the
drv though they can belong to different radios and thereby operating on
different frequencies.

wpa_driver_nl80211_send_mlme() uses bss->flink->freq to send Management
frames to the driver which fails as the driver complains that the TX
frequency doesn't match its operating frequency.

Currently in wpa_driver_nl80211_set_ap(), for ML BSS the above mentioned
default value is overridden whenever beacon is set. Fix this by
overriding link frequency also for non-ML BSSs.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
src/drivers/driver_nl80211.c

index 56a412732d6e41caad2f18946fc6997ecff0a705..024eae7ee3fa6636f13bc38ed0ad7bc0f829b29b 100644 (file)
@@ -5214,6 +5214,12 @@ static int wpa_driver_nl80211_set_ap(void *priv,
            nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid))
                goto fail;
 
+       if (params->freq)
+               nl80211_link_set_freq(bss,
+                                     params->mld_ap ? params->mld_link_id :
+                                     NL80211_DRV_LINK_ID_NA,
+                                     params->freq->freq);
+
        if (params->mld_ap) {
                wpa_printf(MSG_DEBUG, "nl80211: link_id=%u",
                           params->mld_link_id);
@@ -5221,10 +5227,6 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID,
                               params->mld_link_id))
                        goto fail;
-
-               if (params->freq)
-                       nl80211_link_set_freq(bss, params->mld_link_id,
-                                             params->freq->freq);
        }
 
        if (params->proberesp && params->proberesp_len) {