]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/wlan-ng: compare using ether_addr_equal_unaligned
authorDenis Pithon <denis.pithon@gmail.com>
Fri, 16 May 2014 22:14:50 +0000 (00:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 17:05:21 +0000 (02:05 +0900)
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: Denis Pithon <denis.pithon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/p80211netdev.c

index 64dd93572ff905c16df47d127d31a368b8a36961..13fe068ce8f4014c748c481150b1c185b9bf5b7f 100644 (file)
@@ -263,7 +263,8 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb)
        /* perform mcast filtering */
        if (wlandev->netdev->flags & IFF_ALLMULTI) {
                /* 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 */
                        if (!(hdr->a1[0] & 0x01))
                                return CONV_TO_ETHER_SKIPPED;