All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Joe Perches <joe@perches.com>
Cc: coreteam@netfilter.org, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	netfilter@vger.kernel.org,
	Bart De Schuymer <bart.de.schuymer@pandora.be>,
	netfilter-devel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [Bridge] [PATCH 04/13] bridge: netfilter: Convert compare_ether_addr to ether_addr_equal
Date: Wed, 9 May 2012 08:07:52 -0700	[thread overview]
Message-ID: <20120509080752.43489fb0@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <5a91d328db3393320170723cdfc9395ad59182c6.1336538938.git.joe@perches.com>

On Tue,  8 May 2012 21:56:48 -0700
Joe Perches <joe@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
> @@
> expression a,b;
> @@
> -	!compare_ether_addr(a, b)
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	compare_ether_addr(a, b)
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!ether_addr_equal(a, b) == 0
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!ether_addr_equal(a, b) != 0
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	ether_addr_equal(a, b) == 0
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	ether_addr_equal(a, b) != 0
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!!ether_addr_equal(a, b)
> +	ether_addr_equal(a, b)
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  net/bridge/netfilter/ebt_stp.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
> index 5b33a2e..071d872 100644
> --- a/net/bridge/netfilter/ebt_stp.c
> +++ b/net/bridge/netfilter/ebt_stp.c
> @@ -164,8 +164,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
>  	    !(info->bitmask & EBT_STP_MASK))
>  		return -EINVAL;
>  	/* Make sure the match only receives stp frames */
> -	if (compare_ether_addr(e->destmac, bridge_ula) ||
> -	    compare_ether_addr(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC))
> +	if (!ether_addr_equal(e->destmac, bridge_ula) ||
> +	    !ether_addr_equal(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC))
>  		return -EINVAL;
>  
>  	return 0;

All look good.
Acked-by: Stephen Hemminger <shemminger@vyatta.com>


WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <shemminger@vyatta.com>
To: Joe Perches <joe@perches.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Bart De Schuymer <bart.de.schuymer@pandora.be>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org,
	coreteam@netfilter.org, bridge@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/13] bridge: netfilter: Convert compare_ether_addr to ether_addr_equal
Date: Wed, 9 May 2012 08:07:52 -0700	[thread overview]
Message-ID: <20120509080752.43489fb0@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <5a91d328db3393320170723cdfc9395ad59182c6.1336538938.git.joe@perches.com>

On Tue,  8 May 2012 21:56:48 -0700
Joe Perches <joe@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
> @@
> expression a,b;
> @@
> -	!compare_ether_addr(a, b)
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	compare_ether_addr(a, b)
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!ether_addr_equal(a, b) == 0
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!ether_addr_equal(a, b) != 0
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	ether_addr_equal(a, b) == 0
> +	!ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	ether_addr_equal(a, b) != 0
> +	ether_addr_equal(a, b)
> 
> @@
> expression a,b;
> @@
> -	!!ether_addr_equal(a, b)
> +	ether_addr_equal(a, b)
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  net/bridge/netfilter/ebt_stp.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
> index 5b33a2e..071d872 100644
> --- a/net/bridge/netfilter/ebt_stp.c
> +++ b/net/bridge/netfilter/ebt_stp.c
> @@ -164,8 +164,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
>  	    !(info->bitmask & EBT_STP_MASK))
>  		return -EINVAL;
>  	/* Make sure the match only receives stp frames */
> -	if (compare_ether_addr(e->destmac, bridge_ula) ||
> -	    compare_ether_addr(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC))
> +	if (!ether_addr_equal(e->destmac, bridge_ula) ||
> +	    !ether_addr_equal(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC))
>  		return -EINVAL;
>  
>  	return 0;

All look good.
Acked-by: Stephen Hemminger <shemminger@vyatta.com>


  reply	other threads:[~2012-05-09 15:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09  4:56 [Bridge] [PATCH 00/13] net: Add and use ether_addr_equal Joe Perches
2012-05-09  4:56 ` Joe Perches
2012-05-09  4:56 ` Joe Perches
2012-05-09  4:56 ` [PATCH 01/13] etherdevice.h: Add ether_addr_equal Joe Perches
2012-05-09  4:56 ` [PATCH 02/13] 802: Convert compare_ether_addr to ether_addr_equal Joe Perches
2012-05-09  4:56 ` [PATCH 03/13] 8021q: " Joe Perches
2012-05-09  4:56 ` [Bridge] [PATCH 04/13] bridge: netfilter: " Joe Perches
2012-05-09  4:56   ` Joe Perches
2012-05-09  4:56   ` Joe Perches
2012-05-09 15:07   ` Stephen Hemminger [this message]
2012-05-09 15:07     ` Stephen Hemminger
2012-05-09  4:56 ` [Bridge] [PATCH 05/13] bridge: " Joe Perches
2012-05-09  4:56   ` Joe Perches
2012-05-09  4:56   ` Joe Perches
2012-05-09  4:56 ` [PATCH 06/13] atm: " Joe Perches
2012-05-09  4:56 ` [PATCH 07/13] bluetooth: " Joe Perches
2012-05-09  4:56   ` Joe Perches
2012-05-09  4:56 ` [PATCH 08/13] mac80211: " Joe Perches
2012-05-09  4:56 ` [PATCH 09/13] mac80211: Convert compare_ether_addr to ether_addr_equal by hand Joe Perches
2012-05-09  4:56 ` [PATCH 10/13] netfilter: Convert compare_ether_addr to ether_addr_equal Joe Perches
2012-05-09  4:56 ` [PATCH 11/13] wireless: " Joe Perches
2012-05-09  4:56 ` [PATCH 12/13] wireless: Convert compare_ether_addr to ether_addr_equal by hand Joe Perches
2012-05-09  4:56 ` [PATCH 13/13] dsa: Convert compare_ether_addr to ether_addr_equal Joe Perches
2012-05-10  1:21 ` [Bridge] [PATCH 00/13] net: Add and use ether_addr_equal David Miller
2012-05-10  1:21   ` David Miller
2012-05-10  1:21   ` David Miller
2012-05-10  1:48   ` [Bridge] " Joe Perches
2012-05-10  1:48     ` Joe Perches
2012-05-10  1:48     ` Joe Perches
2012-05-10  1:53     ` [Bridge] " David Miller
2012-05-10  1:53       ` David Miller
2012-05-10  1:53       ` David Miller
2012-05-10  6:48   ` [Bridge] " Johannes Berg
2012-05-10  6:48     ` Johannes Berg
2012-05-10  6:48     ` Johannes Berg
2012-05-10  6:54     ` [Bridge] " Joe Perches
2012-05-10  6:54       ` Joe Perches
2012-05-10  6:56       ` [Bridge] " Johannes Berg
2012-05-10  6:56         ` Johannes Berg
2012-05-10  6:56         ` Johannes Berg
2012-05-10  7:08         ` [Bridge] " Emmanuel Grumbach
2012-05-10  7:08           ` Emmanuel Grumbach
2012-05-10  7:08           ` Emmanuel Grumbach

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=20120509080752.43489fb0@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=bart.de.schuymer@pandora.be \
    --cc=bridge@lists.linux-foundation.org \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.