diff options
author | Alina Friedrichsen <x-alina@gmx.net> | 2009-01-05 20:41:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:47 -0500 |
commit | 0efcdfd6ed4e7ac74c45e7c3218fd1a7416fdb3f (patch) | |
tree | b186e17ea74875f141e3e727631785410d8c3313 /net/mac80211/mlme.c | |
parent | cca3e99861e883358ceb39ad17c9eaee082138a5 (diff) |
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.c | 9 |
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) | |||
2548 | { | 2548 | { |
2549 | struct ieee80211_if_sta *ifsta; | 2549 | struct ieee80211_if_sta *ifsta; |
2550 | int res; | 2550 | int res; |
2551 | bool valid; | ||
2551 | 2552 | ||
2552 | ifsta = &sdata->u.sta; | 2553 | ifsta = &sdata->u.sta; |
2554 | valid = is_valid_ether_addr(bssid); | ||
2553 | 2555 | ||
2554 | if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { | 2556 | if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { |
2555 | memcpy(ifsta->bssid, bssid, ETH_ALEN); | 2557 | if(valid) |
2558 | memcpy(ifsta->bssid, bssid, ETH_ALEN); | ||
2559 | else | ||
2560 | memset(ifsta->bssid, 0, ETH_ALEN); | ||
2556 | res = 0; | 2561 | res = 0; |
2557 | /* | 2562 | /* |
2558 | * Hack! See also ieee80211_sta_set_ssid. | 2563 | * Hack! See also ieee80211_sta_set_ssid. |
@@ -2566,7 +2571,7 @@ int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid) | |||
2566 | } | 2571 | } |
2567 | } | 2572 | } |
2568 | 2573 | ||
2569 | if (is_valid_ether_addr(bssid)) | 2574 | if (valid) |
2570 | ifsta->flags |= IEEE80211_STA_BSSID_SET; | 2575 | ifsta->flags |= IEEE80211_STA_BSSID_SET; |
2571 | else | 2576 | else |
2572 | ifsta->flags &= ~IEEE80211_STA_BSSID_SET; | 2577 | ifsta->flags &= ~IEEE80211_STA_BSSID_SET; |