diff options
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 76df5eabf268..6b7e92eaab47 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -219,18 +219,26 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
219 | u32 changed) | 219 | u32 changed) |
220 | { | 220 | { |
221 | struct ieee80211_local *local = sdata->local; | 221 | struct ieee80211_local *local = sdata->local; |
222 | static const u8 zero[ETH_ALEN] = { 0 }; | ||
222 | 223 | ||
223 | if (!changed) | 224 | if (!changed) |
224 | return; | 225 | return; |
225 | 226 | ||
226 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 227 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
227 | sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid; | 228 | /* |
228 | else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) | 229 | * While not associated, claim a BSSID of all-zeroes |
230 | * so that drivers don't do any weird things with the | ||
231 | * BSSID at that time. | ||
232 | */ | ||
233 | if (sdata->vif.bss_conf.assoc) | ||
234 | sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid; | ||
235 | else | ||
236 | sdata->vif.bss_conf.bssid = zero; | ||
237 | } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) | ||
229 | sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; | 238 | sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; |
230 | else if (sdata->vif.type == NL80211_IFTYPE_AP) | 239 | else if (sdata->vif.type == NL80211_IFTYPE_AP) |
231 | sdata->vif.bss_conf.bssid = sdata->dev->dev_addr; | 240 | sdata->vif.bss_conf.bssid = sdata->dev->dev_addr; |
232 | else if (ieee80211_vif_is_mesh(&sdata->vif)) { | 241 | else if (ieee80211_vif_is_mesh(&sdata->vif)) { |
233 | static const u8 zero[ETH_ALEN] = { 0 }; | ||
234 | sdata->vif.bss_conf.bssid = zero; | 242 | sdata->vif.bss_conf.bssid = zero; |
235 | } else { | 243 | } else { |
236 | WARN_ON(1); | 244 | WARN_ON(1); |