]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Move VLAN list when the first link (BSS) is removed
authorMuna Sinada <muna.sinada@oss.qualcomm.com>
Mon, 9 Jun 2025 18:06:15 +0000 (11:06 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 29 Sep 2025 19:21:06 +0000 (22:21 +0300)
If the first BSS is removed, move the reference to the VLAN list to the
new first BSS.

Signed-off-by: Muna Sinada <muna.sinada@oss.qualcomm.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
src/ap/hostapd.c

index 161049fc3a3611962d111ce77df1f494051a9b34..2edb46585bed665500ced9c88c2ce8bfdb6f3615 100644 (file)
@@ -617,6 +617,21 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
 }
 
 
+#ifdef CONFIG_IEEE80211BE
+/* hostapd_mld_move_vlan_list - Move the VLAN list to the new first bss
+ *
+ * This function is used to copy the reference to the VLAN list from the old
+ * first BSS to the new first BSS when the first BSS is removed.
+ */
+static void hostapd_mld_move_vlan_list(struct hostapd_data *old_fbss,
+                                      struct hostapd_data *new_fbss)
+{
+       new_fbss->conf->vlan = old_fbss->conf->vlan;
+       old_fbss->conf->vlan = NULL;
+
+}
+#endif /* CONFIG_IEEE80211BE */
+
 /* hostapd_bss_link_deinit - Per-BSS ML cleanup (deinitialization)
  * @hapd: Pointer to BSS data
  *
@@ -5143,8 +5158,16 @@ int hostapd_mld_remove_link(struct hostapd_data *hapd)
        if (dl_list_empty(&mld->links)) {
                mld->fbss = NULL;
        } else {
+               struct hostapd_data *last_link_bss;
+
                next_fbss = dl_list_entry(mld->links.next, struct hostapd_data,
                                          link);
+               last_link_bss = dl_list_last(&mld->links, struct hostapd_data,
+                                            link);
+
+               if (next_fbss != last_link_bss)
+                       hostapd_mld_move_vlan_list(hapd, next_fbss);
+
                mld->fbss = next_fbss;
        }