From: Miguel Fadon Perlines <mfadon@teldat.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>,
Miguel Fadon Perlines <mfadon@teldat.com>
Subject: [PATCH net] arp: fix arp_filter on l3slave devices
Date: Thu, 5 Apr 2018 10:25:38 +0200 [thread overview]
Message-ID: <1522916738-192046-1-git-send-email-mfadon@teldat.com> (raw)
arp_filter performs an ip_route_output search for arp source address and
checks if output device is the same where the arp request was received,
if it is not, the arp request is not answered.
This route lookup is always done on main route table so l3slave devices
never find the proper route and arp is not answered.
Passing l3mdev_master_ifindex_rcu(dev) return value as oif fixes the
lookup for l3slave devices while maintaining same behavior for non
l3slave devices as this function returns 0 in that case.
Signed-off-by: Miguel Fadon Perlines <mfadon@teldat.com>
---
net/ipv4/arp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index f28f06c..7333db1 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -437,7 +437,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
/*unsigned long now; */
struct net *net = dev_net(dev);
- rt = ip_route_output(net, sip, tip, 0, 0);
+ rt = ip_route_output(net, sip, tip, 0, l3mdev_master_ifindex_rcu(dev));
if (IS_ERR(rt))
return 1;
if (rt->dst.dev != dev) {
--
2.1.4
next reply other threads:[~2018-04-05 8:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 8:25 Miguel Fadon Perlines [this message]
2018-04-05 14:40 ` [PATCH net] arp: fix arp_filter on l3slave devices David Ahern
2018-04-06 2:05 ` David Miller
2018-04-09 3:36 ` Sasha Levin
2018-04-09 14:41 ` David Ahern
[not found] <HE1PR07MB087563C78F897EABB6B8F326B6A40@HE1PR07MB0875.eurprd07.prod.outlook.com>
2018-04-04 17:11 ` David Ahern
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=1522916738-192046-1-git-send-email-mfadon@teldat.com \
--to=mfadon@teldat.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).