hostapd: Prevent double interface disabling from segfaulting
Performing, e.g. `wpa_cli -p /var/run/hostapd raw DISABLE` twice led to hostapd segmentation fault if multiple BSSes were configured. Fix this by checking if there is anything to disable at all before trying. Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
This commit is contained in:
parent
ea39367c1b
commit
3fbd036ea9
1 changed files with 7 additions and 0 deletions
|
@ -1692,6 +1692,13 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
|
|||
|
||||
if (hapd_iface == NULL)
|
||||
return -1;
|
||||
|
||||
if (hapd_iface->bss[0]->drv_priv == NULL) {
|
||||
wpa_printf(MSG_INFO, "Interface %s already disabled",
|
||||
hapd_iface->conf->bss[0]->iface);
|
||||
return -1;
|
||||
}
|
||||
|
||||
wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
|
||||
driver = hapd_iface->bss[0]->driver;
|
||||
drv_priv = hapd_iface->bss[0]->drv_priv;
|
||||
|
|
Loading…
Reference in a new issue