From 1f2fbf41d08eeb014bdb1cf120dbd907a3e824d0 Mon Sep 17 00:00:00 2001 From: Kani M Date: Thu, 18 Feb 2021 12:55:44 +0530 Subject: [PATCH] Fix UPDATE_BEACON processing when disabled The hostapd process crashed when the UPDATE_BEACON control interface command was issue after the interface was disabled. Check for this case and return an error if the interface is disabled. Signed-off-by: Kani M --- src/ap/beacon.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 7d9e8b923..15fc2b3db 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1753,6 +1753,11 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) struct wpabuf *beacon, *proberesp, *assocresp; int res, ret = -1; + if (!hapd->drv_priv) { + wpa_printf(MSG_ERROR, "Interface is disabled"); + return -1; + } + if (hapd->csa_in_progress) { wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period"); return -1;