From patchwork Tue Mar 6 13:06:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 144938 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 31BA3B6FA3 for ; Wed, 7 Mar 2012 00:06:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9B1DD9C173; Tue, 6 Mar 2012 08:06:48 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ob-cfmApVos; Tue, 6 Mar 2012 08:06:48 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5DFA89C17C; Tue, 6 Mar 2012 08:06:44 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 221379C17C for ; Tue, 6 Mar 2012 08:06:43 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EKiCVr-R21YG for ; Tue, 6 Mar 2012 08:06:39 -0500 (EST) Received: from na3sys009aog109.obsmtp.com (na3sys009aog109.obsmtp.com [74.125.149.201]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id BF5349C173 for ; Tue, 6 Mar 2012 08:06:37 -0500 (EST) Received: from mail-bk0-f43.google.com ([209.85.214.43]) (using TLSv1) by na3sys009aob109.postini.com ([74.125.148.12]) with SMTP ID DSNKT1YL3LOvZRS3hCrNJ9U5mHGcbV10kuDk@postini.com; Tue, 06 Mar 2012 05:06:37 PST Received: by mail-bk0-f43.google.com with SMTP id j5so8063329bkw.16 for ; Tue, 06 Mar 2012 05:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of coelho@ti.com designates 10.112.101.194 as permitted sender) client-ip=10.112.101.194; Authentication-Results: mr.google.com; spf=pass (google.com: domain of coelho@ti.com designates 10.112.101.194 as permitted sender) smtp.mail=coelho@ti.com Received: from mr.google.com ([10.112.101.194]) by 10.112.101.194 with SMTP id fi2mr11342045lbb.25.1331039196341 (num_hops = 1); Tue, 06 Mar 2012 05:06:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.101.194 with SMTP id fi2mr9267791lbb.25.1331039196169; Tue, 06 Mar 2012 05:06:36 -0800 (PST) Received: from localhost.localdomain (a88-113-65-16.elisa-laajakaista.fi. [88.113.65.16]) by mx.google.com with ESMTPS id mc3sm11844659lab.12.2012.03.06.05.06.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Mar 2012 05:06:35 -0800 (PST) From: Luciano Coelho To: j@w1.fi Subject: [PATCH] hostapd: only update already-set beacons when processing OLBC Date: Tue, 6 Mar 2012 15:06:27 +0200 Message-Id: <1331039187-20484-1-git-send-email-coelho@ti.com> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQnBEGS/ye2EQToQK+nGIv4Fj1rmJG/krsT2pcwalvnEvH9VXG9Znacvi7T3m94BsuSDSsTH Cc: hostap@lists.shmoo.com X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com 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 --- src/ap/ap_list.c | 4 ++-- src/ap/beacon.c | 9 +++++++++ src/ap/beacon.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ap/ap_list.c b/src/ap/ap_list.c index 165cb16..933b158 100644 --- a/src/ap/ap_list.c +++ b/src/ap/ap_list.c @@ -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); } diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 4ea8684..7c77e4b 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -699,4 +699,13 @@ 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 */ diff --git a/src/ap/beacon.h b/src/ap/beacon.h index a944f5f..0dd6021 100644 --- a/src/ap/beacon.h +++ b/src/ap/beacon.h @@ -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 */