From: Muna Sinada Date: Mon, 9 Jun 2025 18:06:15 +0000 (-0700) Subject: AP MLD: Move VLAN list when the first link (BSS) is removed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa7a038e088f14fb0222174407aff41b2080aeb9;p=thirdparty%2Fhostap.git AP MLD: Move VLAN list when the first link (BSS) is removed If the first BSS is removed, move the reference to the VLAN list to the new first BSS. Signed-off-by: Muna Sinada Signed-off-by: Pradeep Kumar Chitrapu --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 161049fc3..2edb46585 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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; }