netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: khc@pm.waw.pl
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Fix IXP4xx Ethernet RX with both IFF_ALLMULTI and IFF_PROMISC.
Date: Tue, 10 Mar 2015 13:32:34 -0400 (EDT)	[thread overview]
Message-ID: <20150310.133234.1336283642054778106.davem@davemloft.net> (raw)
In-Reply-To: <m3pp8hvn8f.fsf@pm.waw.pl>

From: Krzysztof Halasa <khc@pm.waw.pl>
Date: Mon, 09 Mar 2015 23:07:28 +0100

> This long standing bug caused IFF_PROMISC to be ignored when
> IFF_ALLMULTI was requested.
> 
> Also, without any multicast address configured, the driver will use
> device MAC address for the multicast filter, instead of accepting all
> inbound traffic.
> 
> Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>

One big consequence of not basing your patches on the correct tree, is
that you don't even notice when the bug you are fixing is already
fixed (whether partially or fully).

Please see:

commit f81edc6ac1e1e2e2cbe98bcd6ef5ebb7afb00807
Author: Derrick Pallas <pallas@meraki.com>
Date:   Wed Feb 18 00:50:25 2015 -0800

    ethernet/ixp4xx: prevent allmulti from clobbering promisc
    
    If both promisc and allmulti are set, promisc should trump allmulti and
    disable the MAC filter; otherwise, the interface is not really promisc.
    
    Previously, this code checked IFF_ALLMULTI prior to and without regard for
    IFF_PROMISC; if both were set, only multicast and direct unicast traffic
    would make it through the filter.
    
    Signed-off-by: Derrick Pallas <pallas@meraki.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index f7e0f0f..9e16a28 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -938,7 +938,7 @@ static void eth_set_mcast_list(struct net_device *dev)
 	int i;
 	static const u8 allmulti[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
-	if (dev->flags & IFF_ALLMULTI) {
+	if ((dev->flags & IFF_ALLMULTI) && !(dev->flags & IFF_PROMISC)) {
 		for (i = 0; i < ETH_ALEN; i++) {
 			__raw_writel(allmulti[i], &port->regs->mcast_addr[i]);
 			__raw_writel(allmulti[i], &port->regs->mcast_mask[i]);

      reply	other threads:[~2015-03-10 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 22:07 [PATCH] Fix IXP4xx Ethernet RX with both IFF_ALLMULTI and IFF_PROMISC Krzysztof Halasa
2015-03-10 17:32 ` David Miller [this message]

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=20150310.133234.1336283642054778106.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=khc@pm.waw.pl \
    --cc=netdev@vger.kernel.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 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).