All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] arp: fix arp_filter on l3slave devices
@ 2018-04-05  8:25 Miguel Fadon Perlines
  2018-04-05 14:40 ` David Ahern
  2018-04-09  3:36   ` Sasha Levin
  0 siblings, 2 replies; 7+ messages in thread
From: Miguel Fadon Perlines @ 2018-04-05  8:25 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Miguel Fadon Perlines

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
  2018-04-05  8:25 [PATCH net] arp: fix arp_filter on l3slave devices Miguel Fadon Perlines
@ 2018-04-05 14:40 ` David Ahern
  2018-04-06  2:05   ` David Miller
  2018-04-09  3:36   ` Sasha Levin
  1 sibling, 1 reply; 7+ messages in thread
From: David Ahern @ 2018-04-05 14:40 UTC (permalink / raw)
  To: Miguel Fadon Perlines, netdev, David Miller

On 4/5/18 2:25 AM, Miguel Fadon Perlines wrote:
> 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(-)
> 

Acked-by: David Ahern <dsa@cumulusnetworks.com>

DaveM: this is a day 1 bug for VRF. Best guess at a Fixes tag would be:

Fixes: 613d09b30f8b ("net: Use VRF device index for lookups on TX")

It would be good to get this into stable releases 4.9 and up. Thanks,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
  2018-04-05 14:40 ` David Ahern
@ 2018-04-06  2:05   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2018-04-06  2:05 UTC (permalink / raw)
  To: dsahern; +Cc: mfadon, netdev

From: David Ahern <dsahern@gmail.com>
Date: Thu, 5 Apr 2018 08:40:48 -0600

> On 4/5/18 2:25 AM, Miguel Fadon Perlines wrote:
>> 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(-)
>> 
> 
> Acked-by: David Ahern <dsa@cumulusnetworks.com>
> 
> DaveM: this is a day 1 bug for VRF. Best guess at a Fixes tag would be:
> 
> Fixes: 613d09b30f8b ("net: Use VRF device index for lookups on TX")
> 
> It would be good to get this into stable releases 4.9 and up. Thanks,

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
  2018-04-05  8:25 [PATCH net] arp: fix arp_filter on l3slave devices Miguel Fadon Perlines
@ 2018-04-09  3:36   ` Sasha Levin
  2018-04-09  3:36   ` Sasha Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2018-04-09  3:36 UTC (permalink / raw)
  To: Sasha Levin, Miguel Fadon Perlines, netdev; +Cc: David Ahern, stable

Hi,

[This is an automated email]

This commit has been processed by the -stable helper bot and determined
to be a high probability candidate for -stable trees. (score: 33.5930)

The bot has tested the following trees: v4.16, v4.15.15, v4.14.32, v4.9.92, v4.4.126.

v4.16: Build OK!
v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Build OK!
v4.4.126: Build OK!

Please let us know if you'd like to have this patch included in a stable tree.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
@ 2018-04-09  3:36   ` Sasha Levin
  0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2018-04-09  3:36 UTC (permalink / raw)
  To: Sasha Levin, Miguel Fadon Perlines, netdev; +Cc: David Ahern, stable

Hi,

[This is an automated email]

This commit has been processed by the -stable helper bot and determined
to be a high probability candidate for -stable trees. (score: 33.5930)

The bot has tested the following trees: v4.16, v4.15.15, v4.14.32, v4.9.92, v4.4.126.

v4.16: Build OK!
v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Build OK!
v4.4.126: Build OK!

Please let us know if you'd like to have this patch included in a stable tree.

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
  2018-04-09  3:36   ` Sasha Levin
  (?)
@ 2018-04-09 14:41   ` David Ahern
  -1 siblings, 0 replies; 7+ messages in thread
From: David Ahern @ 2018-04-09 14:41 UTC (permalink / raw)
  To: Sasha Levin, Miguel Fadon Perlines, netdev; +Cc: stable

On 4/8/18 9:36 PM, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed by the -stable helper bot and determined
> to be a high probability candidate for -stable trees. (score: 33.5930)
> 
> The bot has tested the following trees: v4.16, v4.15.15, v4.14.32, v4.9.92, v4.4.126.
> 
> v4.16: Build OK!
> v4.15.15: Build OK!
> v4.14.32: Build OK!
> v4.9.92: Build OK!
> v4.4.126: Build OK!

All of those would be good for this patch. Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net] arp: fix arp_filter on l3slave devices
       [not found] <HE1PR07MB087563C78F897EABB6B8F326B6A40@HE1PR07MB0875.eurprd07.prod.outlook.com>
@ 2018-04-04 17:11 ` David Ahern
  0 siblings, 0 replies; 7+ messages in thread
From: David Ahern @ 2018-04-04 17:11 UTC (permalink / raw)
  To: Miguel Fadon Perlines, netdev

On 4/4/18 4:13 AM, Miguel Fadon Perlines wrote:
> 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>
> 
> ---

Miguel: The change looks fine to me. Your mail showed up as html; it
needs to be sent as plain text only.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-09 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05  8:25 [PATCH net] arp: fix arp_filter on l3slave devices Miguel Fadon Perlines
2018-04-05 14:40 ` David Ahern
2018-04-06  2:05   ` David Miller
2018-04-09  3:36 ` Sasha Levin
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.