staging: wlags49_h2: use is_broadcast_ether_addr() instead of memcmp()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 26 Aug 2012 00:52:48 +0000 (08:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Sep 2012 20:16:26 +0000 (13:16 -0700)
Using is_broadcast_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is broadcast
address.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlags49_h2/wl_wext.c

index 7e6bad9273d7ebd737200a387014a2b306a75831..cef12f7f31bd9e6d7be773087adb41b2fe34b415 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/if_arp.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
+#include <linux/etherdevice.h>
 #include <asm/uaccess.h>
 
 #include <debug.h>
@@ -173,7 +174,7 @@ static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr)
 
        switch (key_idx) {
        case 0:
-               if (memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) != 0) {
+               if (!is_broadcast_ether_addr(addr)) {
                        ltv->len = 7;
                        ltv->typ = CFG_REMOVE_TKIP_MAPPED_KEY;
                        memcpy(&ltv->u.u8[0], addr, ETH_ALEN);