]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix crash by clearing link from valid links after stopping beaconing
authorYuvarani V <quic_yuvarani@quicinc.com>
Wed, 23 Apr 2025 07:14:47 +0000 (12:44 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 2 May 2025 20:44:53 +0000 (23:44 +0300)
During link disable in nl80211_remove_link(), the link to be disabled is
cleared from the valid links before calling
nl80211_update_active_links(). This sequence leads to stopping beaconing
on flink, which results in set beacon failure and causes hostapd to
crash when the removed link is enabled.

Fix this by clearing the link from valid links map after the
nl80211_update_active_links() call.

Fixes: 2fe31050c248 ("nl80211: Use active_links to notify start/stop state of links")
Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
src/drivers/driver_nl80211.c

index 2cff5bba08fae09d13f4030db046d8f41020e8ff..2055fb2f2fbe0e2982b114b785e80416aef219a9 100644 (file)
@@ -9679,10 +9679,10 @@ int nl80211_remove_link(struct i802_bss *bss, int link_id)
        os_memcpy(link_addr, link->addr, ETH_ALEN);
 
        /* First remove the link locally */
-       bss->valid_links &= ~BIT(link_id);
        os_memset(link->addr, 0, ETH_ALEN);
        /* Clear the active links and set the flink */
        nl80211_update_active_links(bss, link_id);
+       bss->valid_links &= ~BIT(link_id);
 
        /* If this was the last link, reset default link */
        if (!bss->valid_links) {