2008-02-21 10:08:42

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211: fix IBSS code

This patch fixes two errors introduced by

commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
Author: Bruno Randolf <[email protected]>
Date: Mon Feb 18 11:21:36 2008 +0900

mac80211: enable IBSS merging

The first error is an endianness problem that sparse found and
the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
is not set.

Signed-off-by: Johannes Berg <[email protected]>
Cc: Bruno Randolf <[email protected]>
---
net/mac80211/ieee80211_sta.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- everything.orig/net/mac80211/ieee80211_sta.c 2008-02-21 11:04:18.000000000 +0100
+++ everything/net/mac80211/ieee80211_sta.c 2008-02-21 11:04:32.000000000 +0100
@@ -2412,7 +2412,7 @@ static void ieee80211_rx_bss_info(struct
/* check if we need to merge IBSS */
if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && beacon &&
!local->sta_sw_scanning && !local->sta_hw_scanning &&
- mgmt->u.beacon.capab_info & WLAN_CAPABILITY_IBSS &&
+ bss->capability & WLAN_CAPABILITY_IBSS &&
bss->freq == local->oper_channel->center_freq &&
elems.ssid_len == sdata->u.sta.ssid_len &&
memcmp(elems.ssid, sdata->u.sta.ssid, sdata->u.sta.ssid_len) == 0) {
@@ -2452,7 +2452,9 @@ static void ieee80211_rx_bss_info(struct
jiffies);
#endif /* CONFIG_MAC80211_IBSS_DEBUG */
if (beacon_timestamp > rx_timestamp) {
- if (CONFIG_MAC80211_IBSS_DEBUG || net_ratelimit())
+#ifndef CONFIG_MAC80211_IBSS_DEBUG
+ if (net_ratelimit())
+#endif
printk(KERN_DEBUG "%s: beacon TSF higher than "
"local TSF - IBSS merge with BSSID %s\n",
dev->name, print_mac(mac, mgmt->bssid));




2008-02-21 19:26:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code


On Thu, 2008-02-21 at 12:07 -0500, John W. Linville wrote:
> On Thu, Feb 21, 2008 at 11:08:33AM +0100, Johannes Berg wrote:
> > This patch fixes two errors introduced by
> >
> > commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
> > Author: Bruno Randolf <[email protected]>
> > Date: Mon Feb 18 11:21:36 2008 +0900
> >
> > mac80211: enable IBSS merging
> >
> > The first error is an endianness problem that sparse found and
> > the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
> > is not set.
>
> I think I like Pavel's fix for the CONFIG_MAC80211_IBSS_DEBUG build
> issue better. Do you want to repsin the sparse warning bit? If you
> like, I can respin it for you -- just let me know.

Eh, where do we stand now? Bruno wanted the message to not be rate
limited in the DEBUG case, and the endianness fix is definitely
required.

johannes


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

2008-02-21 18:27:38

by Pavel Roskin

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Thu, 2008-02-21 at 12:32 -0500, John W. Linville wrote:
> On Thu, Feb 21, 2008 at 12:16:02PM -0500, Pavel Roskin wrote:
> > On Thu, 2008-02-21 at 11:08 +0100, Johannes Berg wrote:
> > > - if (CONFIG_MAC80211_IBSS_DEBUG || net_ratelimit())
> > > +#ifndef CONFIG_MAC80211_IBSS_DEBUG
> > > + if (net_ratelimit())
> > > +#endif
> >
> > It looks like you did a better job at guessing the intention of the code
> > than me.
> >
> > Please apply this patch, not mine.
>
> Hmmm...maybe you are right. Unfortunately I already apply your
> patch instead.

I don't really care. It's just a KERN_DEBUG message after all. I see
no problems with using net_ratelimit() in all cases. And I don't see
any strong need to suppress this message. I don't expect it will happen
often. But I'm not the one who will be looking at the logs :)

--
Regards,
Pavel Roskin

2008-02-21 18:04:08

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Thu, Feb 21, 2008 at 12:16:02PM -0500, Pavel Roskin wrote:
> On Thu, 2008-02-21 at 11:08 +0100, Johannes Berg wrote:
> > - if (CONFIG_MAC80211_IBSS_DEBUG || net_ratelimit())
> > +#ifndef CONFIG_MAC80211_IBSS_DEBUG
> > + if (net_ratelimit())
> > +#endif
>
> It looks like you did a better job at guessing the intention of the code
> than me.
>
> Please apply this patch, not mine.

Hmmm...maybe you are right. Unfortunately I already apply your
patch instead.

Johannes, I'll refactor this patch on top of proski's to get your
original intended result.

Thanks,

John
--
John W. Linville
[email protected]

2008-02-21 20:03:11

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Thu, Feb 21, 2008 at 08:23:56PM +0100, Johannes Berg wrote:
>
> On Thu, 2008-02-21 at 12:07 -0500, John W. Linville wrote:
> > On Thu, Feb 21, 2008 at 11:08:33AM +0100, Johannes Berg wrote:
> > > This patch fixes two errors introduced by
> > >
> > > commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
> > > Author: Bruno Randolf <[email protected]>
> > > Date: Mon Feb 18 11:21:36 2008 +0900
> > >
> > > mac80211: enable IBSS merging
> > >
> > > The first error is an endianness problem that sparse found and
> > > the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
> > > is not set.
> >
> > I think I like Pavel's fix for the CONFIG_MAC80211_IBSS_DEBUG build
> > issue better. Do you want to repsin the sparse warning bit? If you
> > like, I can respin it for you -- just let me know.
>
> Eh, where do we stand now? Bruno wanted the message to not be rate
> limited in the DEBUG case, and the endianness fix is definitely
> required.

I'll rebase your original patch on top of what is there now. I.E. the
result will be as if I had only applied your patch.

John
--
John W. Linville
[email protected]

2008-02-21 17:33:14

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Thu, Feb 21, 2008 at 11:08:33AM +0100, Johannes Berg wrote:
> This patch fixes two errors introduced by
>
> commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
> Author: Bruno Randolf <[email protected]>
> Date: Mon Feb 18 11:21:36 2008 +0900
>
> mac80211: enable IBSS merging
>
> The first error is an endianness problem that sparse found and
> the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
> is not set.

I think I like Pavel's fix for the CONFIG_MAC80211_IBSS_DEBUG build
issue better. Do you want to repsin the sparse warning bit? If you
like, I can respin it for you -- just let me know.

Thanks,

John
--
John W. Linville
[email protected]

2008-02-21 17:16:04

by Pavel Roskin

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Thu, 2008-02-21 at 11:08 +0100, Johannes Berg wrote:
> - if (CONFIG_MAC80211_IBSS_DEBUG || net_ratelimit())
> +#ifndef CONFIG_MAC80211_IBSS_DEBUG
> + if (net_ratelimit())
> +#endif

It looks like you did a better job at guessing the intention of the code
than me.

Please apply this patch, not mine.

--
Regards,
Pavel Roskin

2008-02-22 00:51:17

by Bruno Randolf

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix IBSS code

On Friday 22 February 2008 04:43:07 John W. Linville wrote:
> On Thu, Feb 21, 2008 at 08:23:56PM +0100, Johannes Berg wrote:
> > On Thu, 2008-02-21 at 12:07 -0500, John W. Linville wrote:
> > > On Thu, Feb 21, 2008 at 11:08:33AM +0100, Johannes Berg wrote:
> > > > This patch fixes two errors introduced by
> > > >
> > > > commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
> > > > Author: Bruno Randolf <[email protected]>
> > > > Date: Mon Feb 18 11:21:36 2008 +0900
> > > >
> > > > mac80211: enable IBSS merging
> > > >
> > > > The first error is an endianness problem that sparse found and
> > > > the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
> > > > is not set.
> > >
> > > I think I like Pavel's fix for the CONFIG_MAC80211_IBSS_DEBUG build
> > > issue better. Do you want to repsin the sparse warning bit? If you
> > > like, I can respin it for you -- just let me know.
> >
> > Eh, where do we stand now? Bruno wanted the message to not be rate
> > limited in the DEBUG case, and the endianness fix is definitely
> > required.
>
> I'll rebase your original patch on top of what is there now. I.E. the
> result will be as if I had only applied your patch.

sorry, i should have tested the patch with IBSS debugging disabled, too :(

bruno