summaryrefslogtreecommitdiff
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorAlina Friedrichsen <x-alina@gmx.net>2009-01-06 04:41:35 +0300
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 23:59:47 +0300
commit0efcdfd6ed4e7ac74c45e7c3218fd1a7416fdb3f (patch)
treeb186e17ea74875f141e3e727631785410d8c3313 /net/mac80211/mlme.c
parentcca3e99861e883358ceb39ad17c9eaee082138a5 (diff)
downloadlinux-0efcdfd6ed4e7ac74c45e7c3218fd1a7416fdb3f.tar.xz
mac80211: Disallow to set multicast BSSID
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 12976026cc45..f80dc2535709 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2548,11 +2548,16 @@ int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid)
{
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.
@@ -2566,7 +2571,7 @@ int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid)
}
}
- if (is_valid_ether_addr(bssid))
+ if (valid)
ifsta->flags |= IEEE80211_STA_BSSID_SET;
else
ifsta->flags &= ~IEEE80211_STA_BSSID_SET;