]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter
authorVerma, Aashish <aashishx.verma@intel.com>
Fri, 7 Feb 2020 07:33:54 +0000 (15:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:24 +0000 (04:37 -0800)
[ Upstream commit 2ba31cd93784b61813226d259fd94a221ecd9d61 ]

Without checking for IFF_MULTICAST flag, it is wrong to assume multicast
filtering is always enabled. By checking against IFF_MULTICAST, now
the driver behaves correctly when the multicast support is toggled by below
command:-
  ip link set <devname> multicast off|on

Fixes: 477286b53f55 ("stmmac: add GMAC4 core support")
Signed-off-by: Verma, Aashish <aashishx.verma@intel.com>
Tested-by: Tan, Tee Min <tee.min.tan@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

index 6e3d0ab0ecd6d2a8c7da0e137874c4855409e426..53be936137d054887a5051422087e7bcc2242881 100644 (file)
@@ -420,7 +420,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
                value |= GMAC_PACKET_FILTER_PM;
                /* Set all the bits of the HASH tab */
                memset(mc_filter, 0xff, sizeof(mc_filter));
-       } else if (!netdev_mc_empty(dev)) {
+       } else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) {
                struct netdev_hw_addr *ha;
 
                /* Hash filter for multicast */