Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv4: Restore flowi4_oif update before call to xfrm_lookup_route

Tobias reported regressions in IPsec tests following the patch
referenced by the Fixes tag below. The root cause is dropping the
reset of the flowi4_oif after the fib_lookup. Apparently it is
needed for xfrm cases, so restore the oif update to ip_route_output_flow
right before the call to xfrm_lookup_route.

Fixes: 2fbc6e89b2f1 ("ipv4: Update exception handling for multipath routes via same device")
Reported-by: Tobias Brunner <tobias@strongswan.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

David Ahern and committed by
Jakub Kicinski
874fb9e2 49fb2f33

+3 -1
+3 -1
net/ipv4/route.c
··· 2769 2769 if (IS_ERR(rt)) 2770 2770 return rt; 2771 2771 2772 - if (flp4->flowi4_proto) 2772 + if (flp4->flowi4_proto) { 2773 + flp4->flowi4_oif = rt->dst.dev->ifindex; 2773 2774 rt = (struct rtable *)xfrm_lookup_route(net, &rt->dst, 2774 2775 flowi4_to_flowi(flp4), 2775 2776 sk, 0); 2777 + } 2776 2778 2777 2779 return rt; 2778 2780 }