From c08b1dd8c1ff0f5f1b33207dd1a35ff9057d3c80 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sun, 26 Aug 2012 08:54:41 +0800 Subject: [PATCH] --- yaml --- r: 327900 b: refs/heads/master c: 35622dc26eeb1c9046df659be43b3a9316b0bf65 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/hostap/hostap_ioctl.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 025358a0790f..b15aad7d25cd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4653356f695900de170779fc522e2fc41d710897 +refs/heads/master: 35622dc26eeb1c9046df659be43b3a9316b0bf65 diff --git a/trunk/drivers/net/wireless/hostap/hostap_ioctl.c b/trunk/drivers/net/wireless/hostap/hostap_ioctl.c index 18054d9c6688..ac074731335a 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/trunk/drivers/net/wireless/hostap/hostap_ioctl.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "hostap_wlan.h" @@ -3221,8 +3222,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev, return -EINVAL; addr = ext->addr.sa_data; - if (addr[0] == 0xff && addr[1] == 0xff && addr[2] == 0xff && - addr[3] == 0xff && addr[4] == 0xff && addr[5] == 0xff) { + if (is_broadcast_ether_addr(addr)) { sta_ptr = NULL; crypt = &local->crypt_info.crypt[i]; } else { @@ -3394,8 +3394,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev, i--; addr = ext->addr.sa_data; - if (addr[0] == 0xff && addr[1] == 0xff && addr[2] == 0xff && - addr[3] == 0xff && addr[4] == 0xff && addr[5] == 0xff) { + if (is_broadcast_ether_addr(addr)) { sta_ptr = NULL; crypt = &local->crypt_info.crypt[i]; } else { @@ -3458,9 +3457,7 @@ static int prism2_ioctl_set_encryption(local_info_t *local, param->u.crypt.key_len) 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)) { if (param->u.crypt.idx >= WEP_KEYS) return -EINVAL; sta_ptr = NULL; @@ -3593,9 +3590,7 @@ static int prism2_ioctl_get_encryption(local_info_t *local, 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_ptr = NULL; if (param->u.crypt.idx >= WEP_KEYS) param->u.crypt.idx = local->crypt_info.tx_keyidx;