]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Set link_id field in hostapd_freq_params when setting up AP
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 17 Apr 2024 01:23:30 +0000 (06:53 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 22 Apr 2024 20:33:15 +0000 (23:33 +0300)
If not set, 0 is set by default and this could fail in the following
code path when link ID is not matching:
hostapd_drv_set_ap -> wpa_driver_nl80211_set_ap -> nl80211_set_channel

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
src/ap/beacon.c

index 8c2e491cbf5d16dd4dd95df3279d490be1e85fe3..ce806edf1856e1f5cb9ca16cd1af7c572f5157d9 100644 (file)
@@ -2626,8 +2626,14 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
                                    cmode->vht_capab,
                                    &cmode->he_capab[IEEE80211_MODE_AP],
                                    &cmode->eht_capab[IEEE80211_MODE_AP],
-                                   hostapd_get_punct_bitmap(hapd)) == 0)
+                                   hostapd_get_punct_bitmap(hapd)) == 0) {
+               freq.link_id = -1;
+#ifdef CONFIG_IEEE80211BE
+               if (hapd->conf->mld_ap)
+                       freq.link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
                params.freq = &freq;
+       }
 
        for (i = 0; i < hapd->iface->num_hw_features; i++) {
                mode = &hapd->iface->hw_features[i];