]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix UPDATE_BEACON processing when disabled
authorKani M <kanisumi@codeaurora.org>
Thu, 18 Feb 2021 07:25:44 +0000 (12:55 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 21 Apr 2021 20:23:54 +0000 (23:23 +0300)
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 <kanisumi@codeaurora.org>
src/ap/beacon.c

index 7d9e8b9230c26b42b2491f38e07134c897519625..15fc2b3db064d2afe6dfe2b4f498ccebf7edca36 100644 (file)
@@ -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;