All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] vrf: Fix IPv6 with qdisc and xfrm
@ 2020-04-21 23:48 David Ahern
  2020-04-23  2:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2020-04-21 23:48 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, David Ahern

From: David Ahern <dsahern@gmail.com>

When a qdisc is attached to the VRF device, the packet goes down the ndo
xmit function which is setup to send the packet back to the VRF driver
which does a lookup to send the packet out. The lookup in the VRF driver
is not considering xfrm policies. Change it to use ip6_dst_lookup_flow
rather than ip6_route_output.

Fixes: 35402e313663 ("net: Add IPv6 support to VRF device")
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 drivers/net/vrf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 6f5d03b7d9c0..56f8aab46f89 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -188,8 +188,8 @@ static netdev_tx_t vrf_process_v6_outbound(struct sk_buff *skb,
 	fl6.flowi6_proto = iph->nexthdr;
 	fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF;
 
-	dst = ip6_route_output(net, NULL, &fl6);
-	if (dst == dst_null)
+	dst = ip6_dst_lookup_flow(net, NULL, &fl6, NULL);
+	if (IS_ERR(dst) || dst == dst_null)
 		goto err;
 
 	skb_dst_drop(skb);
-- 
2.20.1


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

* Re: [PATCH net] vrf: Fix IPv6 with qdisc and xfrm
  2020-04-21 23:48 [PATCH net] vrf: Fix IPv6 with qdisc and xfrm David Ahern
@ 2020-04-23  2:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-23  2:31 UTC (permalink / raw)
  To: dsahern; +Cc: kuba, netdev, dsahern

From: David Ahern <dsahern@kernel.org>
Date: Tue, 21 Apr 2020 17:48:27 -0600

> From: David Ahern <dsahern@gmail.com>
> 
> When a qdisc is attached to the VRF device, the packet goes down the ndo
> xmit function which is setup to send the packet back to the VRF driver
> which does a lookup to send the packet out. The lookup in the VRF driver
> is not considering xfrm policies. Change it to use ip6_dst_lookup_flow
> rather than ip6_route_output.
> 
> Fixes: 35402e313663 ("net: Add IPv6 support to VRF device")
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied and queued up for -stable, thanks David.

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

end of thread, other threads:[~2020-04-23  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 23:48 [PATCH net] vrf: Fix IPv6 with qdisc and xfrm David Ahern
2020-04-23  2:31 ` David Miller

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.