Joe Perches | 9 May 2012 06:56

[PATCH 00/13] net: Add and use ether_addr_equal

Add a boolean function to test 2 ethernet addresses for equality
Convert compare_ether_addr uses to ether_addr_equal

Joe Perches (13):
  etherdevice.h: Add ether_addr_equal
  802: Convert compare_ether_addr to ether_addr_equal
  8021q: Convert compare_ether_addr to ether_addr_equal
  bridge: netfilter: Convert compare_ether_addr to ether_addr_equal
  bridge: Convert compare_ether_addr to ether_addr_equal
  atm: Convert compare_ether_addr to ether_addr_equal
  bluetooth: Convert compare_ether_addr to ether_addr_equal
  mac80211: Convert compare_ether_addr to ether_addr_equal
  mac80211: Convert compare_ether_addr to ether_addr_equal by hand
  netfilter: Convert compare_ether_addr to ether_addr_equal
  wireless: Convert compare_ether_addr to ether_addr_equal
  wireless: Convert compare_ether_addr to ether_addr_equal by hand
  dsa: Convert compare_ether_addr to ether_addr_equal

 include/linux/etherdevice.h               |   12 +++++++++
 net/802/stp.c                             |    2 +-
 net/8021q/vlan.c                          |   10 +++---
 net/8021q/vlan_core.c                     |    3 +-
 net/8021q/vlan_dev.c                      |   10 +++---
 net/atm/lec.c                             |    6 ++--
 net/atm/mpc.c                             |    3 +-
 net/bluetooth/bnep/core.c                 |    6 ++--
 net/bridge/br_device.c                    |    2 +-
 net/bridge/br_fdb.c                       |   14 +++++-----
 net/bridge/br_input.c                     |    2 +-
 net/bridge/br_stp_bpdu.c                  |    2 +-
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 04/13] bridge: netfilter: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Stephen Hemminger | 9 May 2012 17:07
Favicon

Re: [PATCH 04/13] bridge: netfilter: Convert compare_ether_addr to ether_addr_equal

On Tue,  8 May 2012 21:56:48 -0700
Joe Perches <joe <at> perches.com> wrote:

> Use the new bool function ether_addr_equal to add
> some clarity and reduce the likelihood for misuse
> of compare_ether_addr for sorting.
> 
> Done via cocci script:
> 
> $ cat compare_ether_addr.cocci
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	!compare_ether_addr(a, b)
> +	ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	compare_ether_addr(a, b)
> +	!ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	!ether_addr_equal(a, b) == 0
> +	ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
(Continue reading)

Stephen Hemminger | 9 May 2012 17:07
Favicon

Re: [PATCH 04/13] bridge: netfilter: Convert compare_ether_addr to ether_addr_equal

On Tue,  8 May 2012 21:56:48 -0700
Joe Perches <joe <at> perches.com> wrote:

> Use the new bool function ether_addr_equal to add
> some clarity and reduce the likelihood for misuse
> of compare_ether_addr for sorting.
> 
> Done via cocci script:
> 
> $ cat compare_ether_addr.cocci
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	!compare_ether_addr(a, b)
> +	ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	compare_ether_addr(a, b)
> +	!ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
>  <at>  <at> 
> -	!ether_addr_equal(a, b) == 0
> +	ether_addr_equal(a, b)
> 
>  <at>  <at> 
> expression a,b;
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 05/13] bridge: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 06/13] atm: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 07/13] bluetooth: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 08/13] mac80211: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 11/13] wireless: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

I removed a conversion from scan.c/cmp_bss_core
that appears to be a sorting function.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 12/13] wireless: Convert compare_ether_addr to ether_addr_equal by hand

spatch/coccinelle isn't perfect.  It doesn't understand
__aligned(x) and doesn't convert functions it can't parse.

Convert the remaining compare_ether_addr uses.

Signed-off-by: Joe Perches <joe <at> perches.com>
---
 net/wireless/util.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 3ba366f..1cd2558 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
 <at>  <at>  -370,7 +370,7  <at>  <at>  int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
 		     iftype != NL80211_IFTYPE_P2P_CLIENT &&
 		     iftype != NL80211_IFTYPE_MESH_POINT) ||
 		    (is_multicast_ether_addr(dst) &&
-		     !compare_ether_addr(src, addr)))
+		     ether_addr_equal(src, addr)))
 			return -1;
 		if (iftype == NL80211_IFTYPE_MESH_POINT) {
 			struct ieee80211s_hdr *meshdr =
 <at>  <at>  -398,9 +398,9  <at>  <at>  int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
 	payload = skb->data + hdrlen;
 	ethertype = (payload[6] << 8) | payload[7];

-	if (likely((compare_ether_addr(payload, rfc1042_header) == 0 &&
+	if (likely((ether_addr_equal(payload, rfc1042_header) &&
 		    ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 09/13] mac80211: Convert compare_ether_addr to ether_addr_equal by hand

spatch/coccinelle isn't perfect.  It doesn't understand
__aligned(x) and doesn't convert functions it can't parse.

Convert the remaining compare_ether_addr uses.

Signed-off-by: Joe Perches <joe <at> perches.com>
---
 net/mac80211/rx.c       |    4 ++--
 net/mac80211/sta_info.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 26bfd6f..d722c40 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
 <at>  <at>  -1714,8 +1714,8  <at>  <at>  static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc)
 	 * of whether the frame was encrypted or not.
 	 */
 	if (ehdr->h_proto == rx->sdata->control_port_protocol &&
-	    (compare_ether_addr(ehdr->h_dest, rx->sdata->vif.addr) == 0 ||
-	     compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0))
+	    (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
+	     ether_addr_equal(ehdr->h_dest, pae_group_addr)))
 		return true;

 	if (ieee80211_802_1x_port_control(rx) ||
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index f75f5d9..e920b22 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 10/13] netfilter: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 13/13] dsa: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 03/13] 8021q: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 02/13] 802: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

 <at>  <at> 
expression a,b;
 <at>  <at> 
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)
(Continue reading)

Joe Perches | 9 May 2012 06:56

[PATCH 01/13] etherdevice.h: Add ether_addr_equal

Add a boolean function to check if 2 ethernet addresses
are the same.

This is to avoid any confusion about compare_ether_addr
returning an unsigned, and not being able to use the
compare_ether_addr function for sorting ala memcmp.

Signed-off-by: Joe Perches <joe <at> perches.com>
---
 include/linux/etherdevice.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index c47631f..f330114 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
 <at>  <at>  -171,6 +171,18  <at>  <at>  static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
 	return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
 }

+/**
+ * ether_addr_equal - Compare two Ethernet addresses
+ *  <at> addr1: Pointer to a six-byte array containing the Ethernet address
+ *  <at> addr2: Pointer other six-byte array containing the Ethernet address
+ *
+ * Compare two ethernet addresses, returns true if equal
+ */
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+	return !compare_ether_addr(addr1, addr2);
(Continue reading)

David Miller | 10 May 2012 03:21
Favicon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

From: Joe Perches <joe <at> perches.com>
Date: Tue,  8 May 2012 21:56:44 -0700

> Add a boolean function to test 2 ethernet addresses for equality
> Convert compare_ether_addr uses to ether_addr_equal

This series looks great, I'll apply all of it.

Thanks Joe.

That case you didn't convert in mac80211 is probably the
bug Johannes was talking about which started this whole
discussion.
Joe Perches | 10 May 2012 03:48

Re: [PATCH 00/13] net: Add and use ether_addr_equal

On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:
> From: Joe Perches <joe <at> perches.com>
> Date: Tue,  8 May 2012 21:56:44 -0700
> 
> > Add a boolean function to test 2 ethernet addresses for equality
> > Convert compare_ether_addr uses to ether_addr_equal
> 
> This series looks great, I'll apply all of it.

coccinelle is a nifty, better sed, tool.  Thanks Julia et al.

> That case you didn't convert in mac80211 is probably the
> bug Johannes was talking about which started this whole
> discussion.

Looks like it.

Do you want a similar patch/patches for drivers/net?

If I break it out by nominal driver/maintainer,
it'll be a highish number of low density patches.

$ git grep -w compare_ether_addr drivers/net | wc -l
59
$ git grep -w -l compare_ether_addr drivers/net | wc -l
31

Maybe just a single patch?

Also the compare_ether_addr_64bits function is
(Continue reading)

David Miller | 10 May 2012 03:53
Favicon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

From: Joe Perches <joe <at> perches.com>
Date: Wed, 09 May 2012 18:48:04 -0700

> Maybe just a single patch?

Yes, I think high density on this one, it's extremely
mechanical.

> Also the compare_ether_addr_64bits function is
> still used a couple dozen times.  Maybe another
> patch for those?  ether_addr_equal_64bits?

Use your best judgment.
Johannes Berg | 10 May 2012 08:48
Favicon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:

> That case you didn't convert in mac80211 is probably the
> bug Johannes was talking about which started this whole
> discussion.

The bug case that started it all is in net/wireless/scan.c and Emmanuel
has since changed it back to memcmp(). Not sure if that's the one you
were referring to or not :-)

johannes
Joe Perches | 10 May 2012 08:54

Re: [PATCH 00/13] net: Add and use ether_addr_equal

On Thu, 2012-05-10 at 08:48 +0200, Johannes Berg wrote:
> On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:
> 
> > That case you didn't convert in mac80211 is probably the
> > bug Johannes was talking about which started this whole
> > discussion.
> 
> The bug case that started it all is in net/wireless/scan.c and Emmanuel
> has since changed it back to memcmp(). Not sure if that's the one you
> were referring to or not :-)

That's the one that I left alone.

Post patch:
$ git grep -n -w compare_ether_addr net
net/batman-adv/main.h:198: * note: can't use compare_ether_addr() as it requires aligned memory
net/wireless/scan.c:381:        return compare_ether_addr(a->bssid, b->bssid);

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Johannes Berg | 10 May 2012 08:56
Favicon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

On Wed, 2012-05-09 at 23:54 -0700, Joe Perches wrote:
> On Thu, 2012-05-10 at 08:48 +0200, Johannes Berg wrote:
> > On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:
> > 
> > > That case you didn't convert in mac80211 is probably the
> > > bug Johannes was talking about which started this whole
> > > discussion.
> > 
> > The bug case that started it all is in net/wireless/scan.c and Emmanuel
> > has since changed it back to memcmp(). Not sure if that's the one you
> > were referring to or not :-)
> 
> That's the one that I left alone.
> 
> Post patch:
> $ git grep -n -w compare_ether_addr net
> net/batman-adv/main.h:198: * note: can't use compare_ether_addr() as it requires aligned memory
> net/wireless/scan.c:381:        return compare_ether_addr(a->bssid, b->bssid);

Ok, great, then that means the fix from Emmanuel won't conflict when it
gets in.

johannes
Emmanuel Grumbach | 10 May 2012 09:08
Picon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

>> >
>> > > That case you didn't convert in mac80211 is probably the
>> > > bug Johannes was talking about which started this whole
>> > > discussion.
>> >
>> > The bug case that started it all is in net/wireless/scan.c and Emmanuel
>> > has since changed it back to memcmp(). Not sure if that's the one you
>> > were referring to or not :-)
>>
>> That's the one that I left alone.
>>
>> Post patch:
>> $ git grep -n -w compare_ether_addr net
>> net/batman-adv/main.h:198: * note: can't use compare_ether_addr() as it requires aligned memory
>> net/wireless/scan.c:381:        return compare_ether_addr(a->bssid, b->bssid);
>
> Ok, great, then that means the fix from Emmanuel won't conflict when it
> gets in.
>

Thanks Joe - as Johannes said this won't conflict with my patch. And
yes the code is now more clear.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Emmanuel Grumbach | 10 May 2012 09:08
Picon

Re: [PATCH 00/13] net: Add and use ether_addr_equal

>> >
>> > > That case you didn't convert in mac80211 is probably the
>> > > bug Johannes was talking about which started this whole
>> > > discussion.
>> >
>> > The bug case that started it all is in net/wireless/scan.c and Emmanuel
>> > has since changed it back to memcmp(). Not sure if that's the one you
>> > were referring to or not :-)
>>
>> That's the one that I left alone.
>>
>> Post patch:
>> $ git grep -n -w compare_ether_addr net
>> net/batman-adv/main.h:198: * note: can't use compare_ether_addr() as it requires aligned memory
>> net/wireless/scan.c:381:        return compare_ether_addr(a->bssid, b->bssid);
>
> Ok, great, then that means the fix from Emmanuel won't conflict when it
> gets in.
>

Thanks Joe - as Johannes said this won't conflict with my patch. And
yes the code is now more clear.
Joe Perches | 10 May 2012 08:54

Re: [PATCH 00/13] net: Add and use ether_addr_equal

On Thu, 2012-05-10 at 08:48 +0200, Johannes Berg wrote:
> On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:
> 
> > That case you didn't convert in mac80211 is probably the
> > bug Johannes was talking about which started this whole
> > discussion.
> 
> The bug case that started it all is in net/wireless/scan.c and Emmanuel
> has since changed it back to memcmp(). Not sure if that's the one you
> were referring to or not :-)

That's the one that I left alone.

Post patch:
$ git grep -n -w compare_ether_addr net
net/batman-adv/main.h:198: * note: can't use compare_ether_addr() as it requires aligned memory
net/wireless/scan.c:381:        return compare_ether_addr(a->bssid, b->bssid);

Gmane