Skip to content

Commit

Permalink
staging: wlags49_h2: use is_broadcast_ether_addr() instead of memcmp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent cb154c1 commit 4f19b38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/wlags49_h2/wl_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4f19b38

Please sign in to comment.