Search Linux Wireless

[PATCH] mac80211: use is_broadcast_ether_addr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change a whole bunch of places to use is_broadcast_ether_addr.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

---
 net/mac80211/ieee80211_ioctl.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-03-27 23:50:18.051396904 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-03-27 23:51:03.501396904 +0200
@@ -410,9 +410,7 @@ static int ieee80211_ioctl_get_info_sta(
 	struct ieee80211_hw_mode *mode;
 	struct sta_info *sta;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		struct net_device_stats *stats;
 
 		stats = ieee80211_dev_stats(local->mdev);
@@ -531,9 +529,7 @@ static int ieee80211_set_encryption(stru
 
 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
-	if (sta_addr[0] == 0xff && sta_addr[1] == 0xff &&
-	    sta_addr[2] == 0xff && sta_addr[3] == 0xff &&
-	    sta_addr[4] == 0xff && sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(sta_addr)) {
 		sta = NULL;
 		if (idx >= NUM_DEFAULT_KEYS) {
 			printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
@@ -799,9 +795,7 @@ static int ieee80211_ioctl_get_encryptio
 	if (max_key_len < 0)
 		return -EINVAL;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		sta = NULL;
 		if (param->u.crypt.idx >= NUM_DEFAULT_KEYS) {
 			param->u.crypt.idx = sdata->default_key ?
@@ -903,9 +897,7 @@ static int ieee80211_ioctl_wpa_trigger(s
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct sta_info *sta;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		local->wpa_trigger = param->u.wpa_trigger.trigger;
 		return 0;
 	}


-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux