Commit 9b3ac7a8 authored by Denis Pithon's avatar Denis Pithon Committed by Greg Kroah-Hartman

staging/wlan-ng: compare using ether_addr_equal_unaligned

Replaced generic memcmp() with dedicated ether_addr_equal_unaligned()
call. I did not find any clue of u16 alignment for both addresses.
Signed-off-by: default avatarDenis Pithon <denis.pithon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae4af9ad
...@@ -263,7 +263,8 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb) ...@@ -263,7 +263,8 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb)
/* perform mcast filtering */ /* perform mcast filtering */
if (wlandev->netdev->flags & IFF_ALLMULTI) { if (wlandev->netdev->flags & IFF_ALLMULTI) {
/* allow my local address through */ /* allow my local address through */
if (memcmp(hdr->a1, wlandev->netdev->dev_addr, ETH_ALEN) != 0) { if (!ether_addr_equal_unaligned(wlandev->netdev->dev_addr,
hdr->a1)) {
/* but reject anything else that isn't multicast */ /* but reject anything else that isn't multicast */
if (!(hdr->a1[0] & 0x01)) if (!(hdr->a1[0] & 0x01))
return CONV_TO_ETHER_SKIPPED; return CONV_TO_ETHER_SKIPPED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment