From 6c850a1c068a32d8f7129d05bc6660ee1575a291 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 25 Feb 2022 22:39:54 +0200 Subject: [PATCH] nl80211: Clear bss->freq when stopping AP mode 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 --- src/drivers/driver_nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0b3c79411..5b01e2b3e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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; }