Skip to contentSkip to conversation

vrf: Fix IPv6 with qdisc and xfrm

PATCH In review David Ahern 2 participants 2 messages Apr 21, 2020 – Apr 23, 2020

Subsystems (3)
lore
Share & tools
lore

David Ahern

author maintainer
#0 lore raw

PATCH 1/1 vrf: Fix IPv6 with qdisc and xfrm

From: David Ahern <[email protected]>

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")
---
 drivers/net/vrf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/vrf.c +2 -2
index 6f5d03b7d9c0..56f8aab46f89 100644
@@ -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);
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: David Ahern <[email protected]>
Date: Tue, 21 Apr 2020 17:48:27 -0600

Quoted 10 lines

From: David Ahern <[email protected]>

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")

Applied and queued up for -stable, thanks David.