]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Only update already-set beacons when processing OLBC
authorLuciano Coelho <coelho@ti.com>
Sun, 1 Apr 2012 15:12:04 +0000 (18:12 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 1 Apr 2012 15:12:04 +0000 (18:12 +0300)
When hostapd is about to start an AP using HT40, it starts a scan to
check whether it is allowed or not. If OLBC is detected before the
scan has completed, it sets the beacons prematurely.

To fix this, instead of setting all beacons when OLBC is detected,
only update the ones that have already been started.

Signed-off-by: Luciano Coelho <coelho@ti.com>
src/ap/ap_list.c
src/ap/beacon.c
src/ap/beacon.h

index 165cb16a0b6530c1048e4fb0fcd646043a008d08..933b1585048f9d5984fa8077b092aac0d7427cbf 100644 (file)
@@ -318,7 +318,7 @@ void ap_list_process_beacon(struct hostapd_iface *iface,
 #endif /* CONFIG_IEEE80211N */
 
        if (set_beacon)
-               ieee802_11_set_beacons(iface);
+               ieee802_11_update_beacons(iface);
 }
 
 
@@ -373,7 +373,7 @@ static void ap_list_timer(void *eloop_ctx, void *timeout_ctx)
        }
 
        if (set_beacon)
-               ieee802_11_set_beacons(iface);
+               ieee802_11_update_beacons(iface);
 }
 
 
index 5efa4cdf95f573d12dd0c92b48b6f16875787a38..0253663d0663fce68f8268a9b024608d4521a045 100644 (file)
@@ -700,4 +700,14 @@ void ieee802_11_set_beacons(struct hostapd_iface *iface)
                ieee802_11_set_beacon(iface->bss[i]);
 }
 
+
+/* only update beacons if started */
+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)
+                       ieee802_11_set_beacon(iface->bss[i]);
+}
+
 #endif /* CONFIG_NATIVE_WINDOWS */
index a944f5f359afb3bf117280cf2d2398e3f4c58e58..0dd6021a8a1201e2279e6c0dc18f6a471fa5472c 100644 (file)
@@ -22,5 +22,6 @@ void handle_probe_req(struct hostapd_data *hapd,
                      const struct ieee80211_mgmt *mgmt, size_t len);
 void ieee802_11_set_beacon(struct hostapd_data *hapd);
 void ieee802_11_set_beacons(struct hostapd_iface *iface);
+void ieee802_11_update_beacons(struct hostapd_iface *iface);
 
 #endif /* BEACON_H */