OSDN Git Service

mac80211: Reject zero MAC address in sta_info_insert_check()
authorYueHaibing <yuehaibing@huawei.com>
Sat, 26 Jun 2021 13:03:34 +0000 (21:03 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 13 Aug 2021 07:50:43 +0000 (09:50 +0200)
As commit 52dba8d7d5ab ("mac80211: reject zero MAC address in add station")
said, we don't consider all-zeroes to be a valid MAC address in most places,
so also reject it here.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20210626130334.13624-1-yuehaibing@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index a5505ee..2b5acb3 100644 (file)
@@ -543,7 +543,7 @@ static int sta_info_insert_check(struct sta_info *sta)
                return -ENETDOWN;
 
        if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
-                   is_multicast_ether_addr(sta->sta.addr)))
+                   !is_valid_ether_addr(sta->sta.addr)))
                return -EINVAL;
 
        /* The RCU read lock is required by rhashtable due to