diff mbox

ethernet/ixp4xx: prevent allmulti from clobbering promisc

Message ID 1424249425-2438-1-git-send-email-pallas@meraki.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Derrick Pallas Feb. 18, 2015, 8:50 a.m. UTC
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>
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Feb. 20, 2015, 8:49 p.m. UTC | #1
From: Derrick Pallas <pallas@meraki.com>
Date: Wed, 18 Feb 2015 00:50:25 -0800

> 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>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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]);