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>
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) {