Patchwork AP: configure basic rates from iface and not conf

login
register
mail settings
Submitter Arik Nemtsov
Date Sept. 3, 2012, 8:58 a.m.
Message ID <1346662707-16777-1-git-send-email-arik@wizery.com>
Download mbox | patch
Permalink /patch/181321/
State Accepted
Commit 44256451130c4766e4a019162de17d0734444ee9
Headers show

Comments

Arik Nemtsov - Sept. 3, 2012, 8:58 a.m.
The conf doesn't contain any basic rates in some cases. Most notably,
when starting a p2p GO in 5Ghz. Use the iface rates which are
initialized in hostapd_prepare_rates() to the conf rates or set to
default values if no conf values exist.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
---
 src/ap/beacon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jouni Malinen - Sept. 6, 2012, 9:25 p.m.
On Mon, Sep 03, 2012 at 11:58:27AM +0300, Arik Nemtsov wrote:
> The conf doesn't contain any basic rates in some cases. Most notably,
> when starting a p2p GO in 5Ghz. Use the iface rates which are
> initialized in hostapd_prepare_rates() to the conf rates or set to
> default values if no conf values exist.

Thanks, applied. Though, I had to fix another issue with commit
e5693c4775bae65faa960f80889f98b0a6cb2e1c first since this patch on its
own would have resulted in buffer read overflow
(hapd->iface->basic_rates did not include the terminating -1 value).

Patch

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 0f29ccd..a1bb067 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -643,7 +643,7 @@  void ieee802_11_set_beacon(struct hostapd_data *hapd)
 	params.proberesp_len = resp_len;
 	params.dtim_period = hapd->conf->dtim_period;
 	params.beacon_int = hapd->iconf->beacon_int;
-	params.basic_rates = hapd->iconf->basic_rates;
+	params.basic_rates = hapd->iface->basic_rates;
 	params.ssid = (u8 *) hapd->conf->ssid.ssid;
 	params.ssid_len = hapd->conf->ssid.ssid_len;
 	params.pairwise_ciphers = hapd->conf->rsn_pairwise ?