summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-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 1297602..f80dc25 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)
{
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);
+ if(valid)
+ memcpy(ifsta->bssid, bssid, ETH_ALEN);
+ else
+ 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;
else
ifsta->flags &= ~IEEE80211_STA_BSSID_SET;