Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1521655

[PATCHv2 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode

From Alexander Kochetkov <al.kochet@gmail.com>
Newsgroups linux.kernel
Subject [PATCHv2 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode
Date 2016-11-14 14:40 +0100
Message-ID <sDpEn-7Av-47@gated-at.bofh.it> (permalink)
References <sDpuF-7x1-25@gated-at.bofh.it> <sDpEm-7Av-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The patch disable capturing multicast packets when multicast mode
disabled for ethernet ('ifconfig eth0 -multicast'). In that case
no multicast packet will be passed to kernel.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
---
Changes in v2:
Add Signed-off-by text.
Removed deleted line from patch.

 drivers/net/ethernet/arc/emac_main.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 2e4ee86..be865b4 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -460,7 +460,7 @@ static void arc_emac_set_rx_mode(struct net_device *ndev)
 		if (ndev->flags & IFF_ALLMULTI) {
 			arc_reg_set(priv, R_LAFL, ~0);
 			arc_reg_set(priv, R_LAFH, ~0);
-		} else {
+		} else if (ndev->flags & IFF_MULTICAST) {
 			struct netdev_hw_addr *ha;
 			unsigned int filter[2] = { 0, 0 };
 			int bit;
@@ -472,6 +472,9 @@ static void arc_emac_set_rx_mode(struct net_device *ndev)
 
 			arc_reg_set(priv, R_LAFL, filter[0]);
 			arc_reg_set(priv, R_LAFH, filter[1]);
+		} else {
+			arc_reg_set(priv, R_LAFL, 0);
+			arc_reg_set(priv, R_LAFH, 0);
 		}
 	}
 }
-- 
1.7.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] net: arc_emac: annonce IFF_MULTICAST support Alexander Kochetkov <al.kochet@gmail.com> - 2016-11-14 14:30 +0100
  [PATCH 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode Alexander Kochetkov <al.kochet@gmail.com> - 2016-11-14 14:30 +0100
    [PATCHv2 1/2] net: arc_emac: annonce IFF_MULTICAST support Alexander Kochetkov <al.kochet@gmail.com> - 2016-11-14 14:40 +0100
      [PATCHv2 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode Alexander Kochetkov <al.kochet@gmail.com> - 2016-11-14 14:40 +0100

csiph-web