]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Clear bss->freq when stopping AP mode
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 25 Feb 2022 20:39:54 +0000 (22:39 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 26 Feb 2022 17:12:11 +0000 (19:12 +0200)
The current operating frequency information was already cleared when
stopping other modes, but the cases for stopping AP mode were not
covered. Clear bss->freq in wpa_driver_nl80211_del_beacon() to cover
these cases. In addition, move clearing of bss->beacon_set there to
avoid having to clear that in all callers separately.

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

index 0b3c79411099edd9594640c692792068d72c0436..5b01e2b3e3cfe84fb6a68df95e2dceacb0c66d37 100644 (file)
@@ -2936,6 +2936,8 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss)
 
        wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
                   drv->ifindex);
+       bss->beacon_set = 0;
+       bss->freq = 0;
        nl80211_put_wiphy_data_ap(bss);
        msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
        return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
@@ -8492,7 +8494,6 @@ static int wpa_driver_nl80211_deinit_ap(void *priv)
        if (!is_ap_interface(drv->nlmode))
                return -1;
        wpa_driver_nl80211_del_beacon(bss);
-       bss->beacon_set = 0;
 
        /*
         * If the P2P GO interface was dynamically added, then it is
@@ -8512,7 +8513,6 @@ static int wpa_driver_nl80211_stop_ap(void *priv)
        if (!is_ap_interface(drv->nlmode))
                return -1;
        wpa_driver_nl80211_del_beacon(bss);
-       bss->beacon_set = 0;
        return 0;
 }