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 <kanisumi@codeaurora.org>
This commit is contained in:
Kani M 2021-02-18 12:55:44 +05:30 committed by Jouni Malinen
parent b8d337c632
commit 1f2fbf41d0

View file

@ -1753,6 +1753,11 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
struct wpabuf *beacon, *proberesp, *assocresp; struct wpabuf *beacon, *proberesp, *assocresp;
int res, ret = -1; int res, ret = -1;
if (!hapd->drv_priv) {
wpa_printf(MSG_ERROR, "Interface is disabled");
return -1;
}
if (hapd->csa_in_progress) { if (hapd->csa_in_progress) {
wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period"); wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period");
return -1; return -1;