]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ethernet/ixp4xx: prevent allmulti from clobbering promisc
authorDerrick Pallas <pallas@meraki.com>
Wed, 18 Feb 2015 08:50:25 +0000 (00:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Feb 2015 20:49:07 +0000 (15:49 -0500)
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>
drivers/net/ethernet/xscale/ixp4xx_eth.c

index f7e0f0f7c2e27dd19b2cbc674644cd4678074c2c..9e16a2819d4850938389c924e18f56184fedd946 100644 (file)
@@ -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]);