]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Remove links when stopping AP MLD in hostapd
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 6 Sep 2023 06:24:58 +0000 (11:54 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 26 Nov 2023 15:05:59 +0000 (17:05 +0200)
There is an issue when starting a non-MLD AP on the same interface that
previous operated as an AP MLD. When the previous AP MLD got stopped,
links were not removed when using hostapd. Next non-MLD AP will fail to
start because some nl80211 operations still require link id (e.g., set
freq).

Remove links when AP MLD is stop to avoid such issue. This was already
done in the deinit_ap() handler when using wpa_supplicant, but hostapd
needs to do same.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/drivers/driver_nl80211.c

index 5a4dac7b613a7d2b1917ee7b043cc5c3bbffb763..06d9d0aa57672117045bc84bbabad46062ea0276 100644 (file)
@@ -193,6 +193,7 @@ static int nl80211_leave_ibss(struct wpa_driver_nl80211_data *drv,
 
 static int i802_set_iface_flags(struct i802_bss *bss, int up);
 static int nl80211_set_param(void *priv, const char *param);
+static void nl80211_remove_links(struct i802_bss *bss);
 #ifdef CONFIG_MESH
 static int nl80211_put_mesh_config(struct nl_msg *msg,
                                   struct wpa_driver_mesh_bss_params *params);
@@ -3185,8 +3186,10 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss)
 
        nl80211_remove_monitor_interface(drv);
 
-       if (is_ap_interface(drv->nlmode))
+       if (is_ap_interface(drv->nlmode)) {
                wpa_driver_nl80211_del_beacon_all(bss);
+               nl80211_remove_links(bss);
+       }
 
        if (drv->eapol_sock >= 0) {
                eloop_unregister_read_sock(drv->eapol_sock);