linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Alina Friedrichsen <x-alina@gmx.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	John Linville <linville@tuxdriver.com>
Subject: Re: [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID
Date: Tue, 06 Jan 2009 14:16:45 +0100	[thread overview]
Message-ID: <1231247805.3503.13.camel@johannes> (raw)
In-Reply-To: <20090106014135.302730@gmx.net> (sfid-20090106_024205_979845_6893AA18)

[-- 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 --]

  reply	other threads:[~2009-01-06 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06  1:41 [PATCH] Fixed BSSID step 1: Disallow to set multicast BSSID Alina Friedrichsen
2009-01-06 13:16 ` Johannes Berg [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231247805.3503.13.camel@johannes \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=x-alina@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).