summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-03-07 04:31:49 +0000
committersam <sam@FreeBSD.org>2007-03-07 04:31:49 +0000
commitbf24ed1972b3a8bf807a8951aa39f776db4aeba0 (patch)
treebace8f0ce2f8fd73421374bc86122483c9e54e2e /sys/net80211
parentd7d6ed3a9225dbb5267f117263e7c0666d2a8fd6 (diff)
downloadFreeBSD-src-bf24ed1972b3a8bf807a8951aa39f776db4aeba0.zip
FreeBSD-src-bf24ed1972b3a8bf807a8951aa39f776db4aeba0.tar.gz
when starting up an ibss master use a random address for
the bssid; this is required for wifi alliance compliance Obtained from: Atheros MFC after: 2 weeks
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_node.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 2be1003..074c32f 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -436,8 +436,11 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS; /* XXX */
if (ic->ic_flags & IEEE80211_F_DESBSSID)
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_des_bssid);
- else
- ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */
+ else {
+ get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN);
+ /* clear group bit, add local bit */
+ ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02;
+ }
} else if (ic->ic_opmode == IEEE80211_M_AHDEMO) {
if (ic->ic_flags & IEEE80211_F_DESBSSID)
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_des_bssid);
OpenPOWER on IntegriCloud