From 77a3e796e1b5118d19ed75960589f8ad520658c2 Mon Sep 17 00:00:00 2001 From: Marek Kwaczynski Date: Thu, 21 Nov 2013 13:33:09 +0100 Subject: [PATCH] hostapd: Fix set beacon in multiple BSSID scenario Check if the BSS interface has started before setting beacon. Lack of this condition can cause segmantation fault. Signed-hostap: Marek Kwaczynski --- src/ap/beacon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 298c0fa13..0e0dae467 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -878,8 +878,10 @@ fail: void ieee802_11_set_beacons(struct hostapd_iface *iface) { size_t i; - for (i = 0; i < iface->num_bss; i++) - ieee802_11_set_beacon(iface->bss[i]); + for (i = 0; i < iface->num_bss; i++) { + if (iface->bss[i]->started) + ieee802_11_set_beacon(iface->bss[i]); + } } @@ -888,7 +890,7 @@ void ieee802_11_update_beacons(struct hostapd_iface *iface) { size_t i; for (i = 0; i < iface->num_bss; i++) - if (iface->bss[i]->beacon_set_done) + if (iface->bss[i]->beacon_set_done && iface->bss[i]->started) ieee802_11_set_beacon(iface->bss[i]); }