[RFC,v2,1/2] hostapd: Derive frequency for BSSes other than the first

Submitted by Yogesh Ashok Powar on Jan. 12, 2012, 11:49 a.m.

Details

Message ID 20120112114911.GA19573@hertz.marvell.com
State Accepted
Commit a7a6af4cbab1e1667ecf15e5aedb00f330a63839
Headers show

Commit Message

Yogesh Ashok Powar Jan. 12, 2012, 11:49 a.m.
Commit e4fb21676972952b5434e8c2a049e239d457abe6 moved frequency
storage from driver struct to bss struct and is assigned in
wpa_driver_nl80211_set_freq. As this wpa_driver_nl80211_set_freq
is triggered only on the first_bss, bss->freq for other BSSes is
never being set to the correct value. This sends MLME frames
on frequency zero (initialized value of freq) for BSSes other than the first.

To fix this deriving frequency value from first_bss.

V2: As suggested by Johannes
    setting bss->freq to right frequency in wpa_driver_nl80211_if_add.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
---
 src/drivers/driver_nl80211.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Jouni Malinen Jan. 29, 2012, 10:30 a.m.
On Thu, Jan 12, 2012 at 05:19:16PM +0530, Yogesh Ashok Powar wrote:
> Commit e4fb21676972952b5434e8c2a049e239d457abe6 moved frequency
> storage from driver struct to bss struct and is assigned in
> wpa_driver_nl80211_set_freq. As this wpa_driver_nl80211_set_freq
> is triggered only on the first_bss, bss->freq for other BSSes is
> never being set to the correct value. This sends MLME frames
> on frequency zero (initialized value of freq) for BSSes other than the first.
> 
> To fix this deriving frequency value from first_bss.
> 
> V2: As suggested by Johannes
>     setting bss->freq to right frequency in wpa_driver_nl80211_if_add.

Thanks! Applied.

Patch hide | download patch | download mbox

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6af8cc9..69e269c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7778,6 +7778,7 @@  static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
 		new_bss->ifindex = ifidx;
 		new_bss->drv = drv;
 		new_bss->next = drv->first_bss.next;
+		new_bss->freq = drv->first_bss.freq;
 		drv->first_bss.next = new_bss;
 		if (drv_priv)
 			*drv_priv = new_bss;