From: Denis Pithon <denis.pithon@gmail.com>
To: gregkh@linuxfoundation.org, tklauser@distanz.ch
Cc: himangi774@gmail.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] staging/wlan-ng: compare using ether_addr_equal_unaligned
Date: Sat, 17 May 2014 00:14:50 +0200 [thread overview]
Message-ID: <1400278492-1673-2-git-send-email-denis.pithon@gmail.com> (raw)
In-Reply-To: <20140516072653.GA14932@distanz.ch>
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>
---
drivers/staging/wlan-ng/p80211netdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 64dd935..13fe068 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -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;
--
1.9.0
next prev parent reply other threads:[~2014-05-16 22:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 15:22 [PATCH 1/4] staging/wlan-ng: update function header comment Denis Pithon
2014-05-12 15:22 ` [PATCH 2/4] staging/wlan-ng: remove function declaration Denis Pithon
2014-05-12 15:22 ` [PATCH 3/4] staging/wlan-ng: code refactoring Denis Pithon
2014-05-16 7:26 ` Tobias Klauser
2014-05-16 22:14 ` Denis Pithon [this message]
2014-05-16 22:14 ` [PATCH 3/4] staging/wlan-ng: multicast address checking Denis Pithon
2014-05-16 22:14 ` [PATCH 4/4] staging/wlan-ng: rearrange comments Denis Pithon
2014-05-16 22:30 ` [PATCH 1/4] staging/wlan-ng: add prefix to function name Denis Pithon
2014-05-12 15:22 ` [PATCH 4/4] staging/wlan-ng: replace printk() with pr_xxx() Denis Pithon
2014-05-14 11:57 ` Dan Carpenter
2014-05-15 21:57 ` Greg KH
2014-05-16 22:24 ` [PATCH] staging/wlan-ng: log with netdev_xxx and dev_xxx Denis Pithon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400278492-1673-2-git-send-email-denis.pithon@gmail.com \
--to=denis.pithon@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=himangi774@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tklauser@distanz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox