2009-10-24 18:55:06

by Björn Smedman

[permalink] [raw]
Subject: [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames

When hostapd injects a frame, e.g. an authentication or association
response, mac80211 looks for a suitable access point virtual interface
to associate the frame with based on its source address. This makes it
possible e.g. to correctly assign sequence numbers to the frames.

A small typo in the ethernet address comparison statement caused a
failure to find a suitable ap interface. Sequence numbers on such
frames where therefore left unassigned causing some clients
(especially windows-based 11b/g clients) to reject them and fail to
authenticate or associate with the access point. This patch fixes the
typo in the address comparison statement.

Signed-off-by: Bj?rn Smedman <[email protected]>
---
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index db4bda6..eaa4118 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct
ieee80211_sub_if_data *sdata,
if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
continue;
if (compare_ether_addr(tmp_sdata->dev->dev_addr,
- hdr->addr2)) {
+ hdr->addr2) == 0) {
dev_hold(tmp_sdata->dev);
dev_put(sdata->dev);
sdata = tmp_sdata;


2009-10-26 12:19:01

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames

On Sunday 25 October 2009 19:59:16 Johannes Berg wrote:
> On Sat, 2009-10-24 at 20:55 +0200, Björn Smedman wrote:
> > When hostapd injects a frame, e.g. an authentication or association
> > response, mac80211 looks for a suitable access point virtual interface
> > to associate the frame with based on its source address. This makes it
> > possible e.g. to correctly assign sequence numbers to the frames.
> >
> > A small typo in the ethernet address comparison statement caused a
> > failure to find a suitable ap interface. Sequence numbers on such
> > frames where therefore left unassigned causing some clients
> > (especially windows-based 11b/g clients) to reject them and fail to
> > authenticate or associate with the access point. This patch fixes the
> > typo in the address comparison statement.
> >
> > Signed-off-by: Björn Smedman <[email protected]>
>
> Reviewed-by: Johannes Berg <[email protected]>
>
> and Cc: [email protected] I think
>
> > ---
> > diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> > index db4bda6..eaa4118 100644
> > --- a/net/mac80211/tx.c
> > +++ b/net/mac80211/tx.c
> > @@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct
> > ieee80211_sub_if_data *sdata,
> > if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
> > continue;
> > if (compare_ether_addr(tmp_sdata->dev->dev_addr,
> > - hdr->addr2)) {
> > + hdr->addr2) == 0) {
> > dev_hold(tmp_sdata->dev);
> > dev_put(sdata->dev);
> > sdata = tmp_sdata;
> >
>
>

The following patch cleanly applies to 2.6.31.5-stable and is tested.

Index: linux-2.6.31/net/mac80211/tx.c
===================================================================
--- linux-2.6.31.orig/net/mac80211/tx.c 2009-10-26 09:15:20.000000000 +0100
+++ linux-2.6.31/net/mac80211/tx.c 2009-10-26 09:16:35.000000000 +0100
@@ -1478,7 +1478,7 @@
if (sdata->vif.type != NL80211_IFTYPE_AP)
continue;
if (compare_ether_addr(sdata->dev->dev_addr,
- hdr->addr2)) {
+ hdr->addr2) == 0) {
dev_hold(sdata->dev);
dev_put(odev);
osdata = sdata;


--
Greetings, Michael.

2009-10-25 18:59:17

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames

On Sat, 2009-10-24 at 20:55 +0200, Björn Smedman wrote:
> When hostapd injects a frame, e.g. an authentication or association
> response, mac80211 looks for a suitable access point virtual interface
> to associate the frame with based on its source address. This makes it
> possible e.g. to correctly assign sequence numbers to the frames.
>
> A small typo in the ethernet address comparison statement caused a
> failure to find a suitable ap interface. Sequence numbers on such
> frames where therefore left unassigned causing some clients
> (especially windows-based 11b/g clients) to reject them and fail to
> authenticate or associate with the access point. This patch fixes the
> typo in the address comparison statement.
>
> Signed-off-by: Björn Smedman <[email protected]>

Reviewed-by: Johannes Berg <[email protected]>

and Cc: [email protected] I think

> ---
> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index db4bda6..eaa4118 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct
> ieee80211_sub_if_data *sdata,
> if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
> continue;
> if (compare_ether_addr(tmp_sdata->dev->dev_addr,
> - hdr->addr2)) {
> + hdr->addr2) == 0) {
> dev_hold(tmp_sdata->dev);
> dev_put(sdata->dev);
> sdata = tmp_sdata;
>


Attachments:
signature.asc (801.00 B)
This is a digitally signed message part

2009-10-27 11:09:06

by Joerg

[permalink] [raw]
Subject: AW: [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames

I just applied the patch. So far, everything looks fine.

Thanks
Joerg

----- Urspr?ngliche Mail ----

> Von: Bj?rn Smedman <[email protected]>
> An: [email protected]
> CC: [email protected]; Johannes Berg <[email protected]>; Jouni Malinen <[email protected]>; Joerg Pommnitz <[email protected]>; Will Dyson <[email protected]>
> Gesendet: Samstag, den 24. Oktober 2009, 20:55:09 Uhr
> Betreff: [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames
>
> When hostapd injects a frame, e.g. an authentication or association
> response, mac80211 looks for a suitable access point virtual interface
> to associate the frame with based on its source address. This makes it
> possible e.g. to correctly assign sequence numbers to the frames.
>
> A small typo in the ethernet address comparison statement caused a
> failure to find a suitable ap interface. Sequence numbers on such
> frames where therefore left unassigned causing some clients
> (especially windows-based 11b/g clients) to reject them and fail to
> authenticate or associate with the access point. This patch fixes the
> typo in the address comparison statement.
>
> Signed-off-by: Bj?rn Smedman

Tested-by: Joerg Pommnitz <[email protected]>

> ---
> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index db4bda6..eaa4118 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct
> ieee80211_sub_if_data *sdata,
> if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
> continue;
> if (compare_ether_addr(tmp_sdata->dev->dev_addr,
> - hdr->addr2)) {
> + hdr->addr2) == 0) {
> dev_hold(tmp_sdata->dev);
> dev_put(sdata->dev);
> sdata = tmp_sdata;