From: Alexander Kochetkov <al.kochet@gmail.com>
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 <al.kochet@gmail.com>
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 [thread overview]
Message-ID: <1479130373-28077-2-git-send-email-al.kochet@gmail.com> (raw)
In-Reply-To: <1479130373-28077-1-git-send-email-al.kochet@gmail.com>
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
prev parent reply other threads:[~2016-11-14 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 13:20 [PATCH 1/2] net: arc_emac: annonce IFF_MULTICAST support Alexander Kochetkov
2016-11-14 13:20 ` [PATCH 2/2] net: arc_emac: don't pass multicast packets to kernel in non-multicast mode Alexander Kochetkov
2016-11-14 13:32 ` [PATCHv2 1/2] net: arc_emac: annonce IFF_MULTICAST support Alexander Kochetkov
2016-11-14 13:32 ` Alexander Kochetkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479130373-28077-2-git-send-email-al.kochet@gmail.com \
--to=al.kochet@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peter.chen@nxp.com \
--cc=tremyfr@gmail.com \
--cc=weiyj.lk@gmail.com \
--cc=wxt@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®