aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
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;