netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: tklauser@distanz.ch
Cc: cmetcalf@tilera.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] netdev: tilepro: Use is_multicast_ether_addr helper
Date: Wed, 12 Jan 2011 23:42:50 -0800 (PST)	[thread overview]
Message-ID: <20110112.234250.10542369.davem@davemloft.net> (raw)
In-Reply-To: <20110113065855.GU29757@distanz.ch>

From: Tobias Klauser <tklauser@distanz.ch>
Date: Thu, 13 Jan 2011 07:58:55 +0100

> On 2011-01-13 at 03:45:01 +0100, David Miller <davem@davemloft.net> wrote:
>> From: Chris Metcalf <cmetcalf@tilera.com>
>> Date: Wed, 12 Jan 2011 12:49:03 -0500
>> 
>> > On 1/12/2011 4:31 AM, Tobias Klauser wrote:
>> >> Use is_multicast_ether_addr from linux/etherdevice.h instead of a custom
>> >> macro. Also remove the broadcast address check, as it is considered a
>> >> multicast address too.
>> >>
>> >> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
>> >> ---
>> >>  drivers/net/tile/tilepro.c |   10 +---------
>> >>  1 files changed, 1 insertions(+), 9 deletions(-)
>> > 
>> > Thanks, I've taken this into the Tilera tree!
>> 
>> Don't, his transformation is buggy.
> 
> Why?
> 
> Doesn't the code want to make sure that only unicast addresses get
> filtered?
> 
>> You can't get rid of the broadcast check, it needs to be there.
>> Think about it.
> 
> If a unicast address is in buf, is_multicast_ether_addr returns false
> (and is_broadcast_addr would too) and thus it would get filtered.

Ok, this may be correct, but it makes the code hard to read.

I think the old code, whilst redundant, is easier to understand.

Why not add a function "is_unicast_ether_addr()" and use that
here instead?

That solves all of the issues I have with your change.

  reply	other threads:[~2011-01-13  7:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12  9:31 [PATCH net-next-2.6] netdev: tilepro: Use is_multicast_ether_addr helper Tobias Klauser
2011-01-12 17:49 ` Chris Metcalf
2011-01-13  2:45   ` David Miller
2011-01-13  6:58     ` Tobias Klauser
2011-01-13  7:42       ` David Miller [this message]
2011-01-13  8:13         ` Tobias Klauser
2011-01-13  8:14         ` [PATCH net-next-2.6] etherdevice.h: Add is_unicast_ether_addr function Tobias Klauser
2011-01-13  8:24           ` Joe Perches
2011-01-13  8:35             ` Tobias Klauser
2011-01-13  8:43               ` Joe Perches
2011-01-13  8:55             ` Eric Dumazet
2011-01-13 16:38               ` Chris Metcalf
2011-01-13 20:35                 ` David Miller
2011-01-14  5:51           ` David Miller
2011-01-13  8:15         ` [PATCH v2 net-next-2.6] netdev: tilepro: Use is_unicast_ether_addr helper Tobias Klauser
2011-01-14  5:51           ` David Miller

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=20110112.234250.10542369.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=cmetcalf@tilera.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).