Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbcKNNft (ORCPT ); Mon, 14 Nov 2016 08:35:49 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33440 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbcKNNdB (ORCPT ); Mon, 14 Nov 2016 08:33:01 -0500 From: Alexander Kochetkov To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, tremyfr@gmail.com, peter.chen@nxp.com, wxt@rock-chips.com, weiyj.lk@gmail.com Cc: Alexander Kochetkov Subject: [PATCHv2 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode Date: Mon, 14 Nov 2016 16:32:53 +0300 Message-Id: <1479130373-28077-2-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1479130373-28077-1-git-send-email-al.kochet@gmail.com> References: <1479129627-27524-2-git-send-email-al.kochet@gmail.com> <1479130373-28077-1-git-send-email-al.kochet@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 38 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 --- 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