Commit 0efcdfd6 authored by Alina Friedrichsen's avatar Alina Friedrichsen Committed by John W. Linville
Browse files

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: default avatarAlina Friedrichsen <>
Signed-off-by: default avatarJohn W. Linville <>
parent cca3e998
......@@ -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);
memcpy(ifsta->bssid, bssid, ETH_ALEN);
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;
ifsta->flags &= ~IEEE80211_STA_BSSID_SET;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment