linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
@ 2009-01-06  1:41 Alina Friedrichsen
  2009-01-06 13:16 ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Alina Friedrichsen @ 2009-01-06  1:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

Okay, here is the first of the five patches. After applying all of them you should be able to build/join huge city mesh networks (e.g. with the OLSR protocol) with the most of the mac80211 wireless drivers by setting a fixed BSSID in the ad hoc mode. (If you found no other bug/problem.) This was not specified in the original standard, but is a widely used de facto standard.

The first patch now completely disallow to set multicast MAC addresses as BSSID. The behavior before was really strange.

Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>

diff -urN compat-wireless-2009-01-05.orig/net/mac80211/mlme.c compat-wireless-2009-01-05.work/net/mac80211/mlme.c
--- compat-wireless-2009-01-05.orig/net/mac80211/mlme.c	2009-01-06 01:38:05.000000000 +0100
+++ compat-wireless-2009-01-05/net/mac80211/mlme.c	2009-01-06 01:47:41.000000000 +0100
@@ -2576,11 +2576,16 @@
 {
 	struct ieee80211_if_sta *ifsta;
 	int res;
+	bool valid;
 
 	ifsta = &sdata->u.sta;
+	valid = is_valid_ether_addr(bssid);
 
 	if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) {
-		memcpy(ifsta->bssid, bssid, ETH_ALEN);
+		if(valid)
+			memcpy(ifsta->bssid, bssid, ETH_ALEN);
+		else
+			memset(ifsta->bssid, 0, ETH_ALEN);
 		res = 0;
 		/*
 		 * Hack! See also ieee80211_sta_set_ssid.
@@ -2594,7 +2599,7 @@
 		}
 	}
 
-	if (is_valid_ether_addr(bssid))
+	if (valid)
 		ifsta->flags |= IEEE80211_STA_BSSID_SET;
 	else
 		ifsta->flags &= ~IEEE80211_STA_BSSID_SET;

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

[-- Attachment #2: step1-disallow-multicast-bssid.patch --]
[-- Type: text/x-patch, Size: 882 bytes --]

diff -urN compat-wireless-2009-01-05.orig/net/mac80211/mlme.c compat-wireless-2009-01-05.work/net/mac80211/mlme.c
--- compat-wireless-2009-01-05.orig/net/mac80211/mlme.c	2009-01-06 01:38:05.000000000 +0100
+++ compat-wireless-2009-01-05/net/mac80211/mlme.c	2009-01-06 01:47:41.000000000 +0100
@@ -2576,11 +2576,16 @@
 {
 	struct ieee80211_if_sta *ifsta;
 	int res;
+	bool valid;
 
 	ifsta = &sdata->u.sta;
+	valid = is_valid_ether_addr(bssid);
 
 	if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) {
-		memcpy(ifsta->bssid, bssid, ETH_ALEN);
+		if(valid)
+			memcpy(ifsta->bssid, bssid, ETH_ALEN);
+		else
+			memset(ifsta->bssid, 0, ETH_ALEN);
 		res = 0;
 		/*
 		 * Hack! See also ieee80211_sta_set_ssid.
@@ -2594,7 +2599,7 @@
 		}
 	}
 
-	if (is_valid_ether_addr(bssid))
+	if (valid)
 		ifsta->flags |= IEEE80211_STA_BSSID_SET;
 	else
 		ifsta->flags &= ~IEEE80211_STA_BSSID_SET;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06  1:41 [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID Alina Friedrichsen
@ 2009-01-06 13:16 ` Johannes Berg
  2009-01-06 18:35   ` Alina Friedrichsen
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2009-01-06 13:16 UTC (permalink / raw)
  To: Alina Friedrichsen; +Cc: linux-wireless, John Linville

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

On Tue, 2009-01-06 at 02:41 +0100, Alina Friedrichsen wrote:
> Okay, here is the first of the five patches. After applying all of them you should be able to build/join huge city mesh networks (e.g. with the OLSR protocol) with the most of the mac80211 wireless drivers by setting a fixed BSSID in the ad hoc mode. (If you found no other bug/problem.) This was not specified in the original standard, but is a widely used de facto standard.
> 
> The first patch now completely disallow to set multicast MAC addresses as BSSID. The behavior before was really strange.
> 
> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>

These look ok to me, with proper changelogs. Thanks. You should have
made the subjects

[PATCH 1/5] mac80211: Disallow ...

etc. and also line-wrapped the changelogs, since these are fed directly
into git normally.

> diff -urN compat-wireless-2009-01-05.orig/net/mac80211/mlme.c compat-wireless-2009-01-05.work/net/mac80211/mlme.c
> --- compat-wireless-2009-01-05.orig/net/mac80211/mlme.c	2009-01-06 01:38:05.000000000 +0100
> +++ compat-wireless-2009-01-05/net/mac80211/mlme.c	2009-01-06 01:47:41.000000000 +0100
> @@ -2576,11 +2576,16 @@
>  {
>  	struct ieee80211_if_sta *ifsta;
>  	int res;
> +	bool valid;
>  
>  	ifsta = &sdata->u.sta;
> +	valid = is_valid_ether_addr(bssid);
>  
>  	if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) {
> -		memcpy(ifsta->bssid, bssid, ETH_ALEN);
> +		if(valid)
> +			memcpy(ifsta->bssid, bssid, ETH_ALEN);
> +		else
> +			memset(ifsta->bssid, 0, ETH_ALEN);
>  		res = 0;
>  		/*
>  		 * Hack! See also ieee80211_sta_set_ssid.
> @@ -2594,7 +2599,7 @@
>  		}
>  	}
>  
> -	if (is_valid_ether_addr(bssid))
> +	if (valid)
>  		ifsta->flags |= IEEE80211_STA_BSSID_SET;
>  	else
>  		ifsta->flags &= ~IEEE80211_STA_BSSID_SET;
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 13:16 ` Johannes Berg
@ 2009-01-06 18:35   ` Alina Friedrichsen
  2009-01-06 18:39     ` Johannes Berg
  2009-01-07  8:49     ` Holger Schurig
  0 siblings, 2 replies; 8+ messages in thread
From: Alina Friedrichsen @ 2009-01-06 18:35 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

Hello Johannes!

> These look ok to me, with proper changelogs. Thanks. You should have
> made the subjects
>=20
> [PATCH 1/5] mac80211: Disallow ...
>=20
> etc. and also line-wrapped the changelogs, since these are fed direct=
ly
> into git normally.

Okay, but can I do this with the next patches and not repost all this a=
gain?

Is there somewhere a git repository, with all the new patches merged? S=
o that I have link where other people can download easily the newest ve=
rsion and test it, to maybe look for other problem in the ad hoc mode, =
before it is in compat-wireless.

Regards
Alina

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 18:35   ` Alina Friedrichsen
@ 2009-01-06 18:39     ` Johannes Berg
  2009-01-06 18:57       ` Luis R. Rodriguez
  2009-01-06 19:03       ` Alina Friedrichsen
  2009-01-07  8:49     ` Holger Schurig
  1 sibling, 2 replies; 8+ messages in thread
From: Johannes Berg @ 2009-01-06 18:39 UTC (permalink / raw)
  To: Alina Friedrichsen; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 847 bytes --]

On Tue, 2009-01-06 at 19:35 +0100, Alina Friedrichsen wrote:
> Hello Johannes!
> 
> > These look ok to me, with proper changelogs. Thanks. You should have
> > made the subjects
> > 
> > [PATCH 1/5] mac80211: Disallow ...
> > 
> > etc. and also line-wrapped the changelogs, since these are fed directly
> > into git normally.
> 
> Okay, but can I do this with the next patches and not repost all this again?

I'll leave that to John to answer, he gets to do the work if you don't
repost.

> Is there somewhere a git repository, with all the new patches merged?
> So that I have link where other people can download easily the newest
> version and test it, to maybe look for other problem in the ad hoc
> mode, before it is in compat-wireless.

well, wireless-testing, but compat-wireless is updated nightly, iirc.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 18:39     ` Johannes Berg
@ 2009-01-06 18:57       ` Luis R. Rodriguez
  2009-01-06 20:05         ` Alina Friedrichsen
  2009-01-06 19:03       ` Alina Friedrichsen
  1 sibling, 1 reply; 8+ messages in thread
From: Luis R. Rodriguez @ 2009-01-06 18:57 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Alina Friedrichsen, linville, linux-wireless

On Tue, Jan 6, 2009 at 10:39 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2009-01-06 at 19:35 +0100, Alina Friedrichsen wrote:

>> Is there somewhere a git repository, with all the new patches merged?
>> So that I have link where other people can download easily the newest
>> version and test it, to maybe look for other problem in the ad hoc
>> mode, before it is in compat-wireless.
>
> well, wireless-testing, but compat-wireless is updated nightly, iirc.

Affirmative.

Alina, check this guide out, it may help you to post your patches:

http://wireless.kernel.org/en/developers/Documentation/git-guide

  Luis

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 18:39     ` Johannes Berg
  2009-01-06 18:57       ` Luis R. Rodriguez
@ 2009-01-06 19:03       ` Alina Friedrichsen
  1 sibling, 0 replies; 8+ messages in thread
From: Alina Friedrichsen @ 2009-01-06 19:03 UTC (permalink / raw)
  To: linville, linux-wireless

Hello Johannes!

> I'll leave that to John to answer, he gets to do the work if you don't
> repost.

Okay, if John want it, I will do this, sorry...

> well, wireless-testing, but compat-wireless is updated nightly, iirc.

Okay, thanks.

cu
Alina

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 18:57       ` Luis R. Rodriguez
@ 2009-01-06 20:05         ` Alina Friedrichsen
  0 siblings, 0 replies; 8+ messages in thread
From: Alina Friedrichsen @ 2009-01-06 20:05 UTC (permalink / raw)
  To: Luis R. Rodriguez, johannes; +Cc: linux-wireless, linville

Hi Luis!

> Alina, check this guide out, it may help you to post your patches:
>=20
> http://wireless.kernel.org/en/developers/Documentation/git-guide

Okay, thanks!

Regards
Alina

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
  2009-01-06 18:35   ` Alina Friedrichsen
  2009-01-06 18:39     ` Johannes Berg
@ 2009-01-07  8:49     ` Holger Schurig
  1 sibling, 0 replies; 8+ messages in thread
From: Holger Schurig @ 2009-01-07  8:49 UTC (permalink / raw)
  To: linux-wireless; +Cc: Alina Friedrichsen, Johannes Berg, linville

> Is there somewhere a git repository, with all the new patches
> merged? So that I have link where other people can download
> easily the newest version and test it, to maybe look for other
> problem in the ad hoc mode, before it is in compat-wireless.

If your patch get's accepted, it will first end in

http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-01-07  8:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-06  1:41 [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID Alina Friedrichsen
2009-01-06 13:16 ` Johannes Berg
2009-01-06 18:35   ` Alina Friedrichsen
2009-01-06 18:39     ` Johannes Berg
2009-01-06 18:57       ` Luis R. Rodriguez
2009-01-06 20:05         ` Alina Friedrichsen
2009-01-06 19:03       ` Alina Friedrichsen
2009-01-07  8:49     ` Holger Schurig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).