From 516d7f88bd0843a41209f6f4f1efc4ee4342f9bc Mon Sep 17 00:00:00 2001 From: Rameshkumar Sundaram Date: Tue, 18 Mar 2025 15:37:14 +0530 Subject: [PATCH] nl80211: Set bss flink frequency for non-ML AP BSS 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 --- src/drivers/driver_nl80211.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 56a412732..024eae7ee 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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) { -- 2.47.2