summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@kernel.org>2020-10-09 11:01:01 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:57:23 +0100
commit3392c9d8f9aa102dba68101d1e67e1efba7ab876 (patch)
tree53f22ab21d2bbb99514fff0e9a60e9924c90fbcd /net
parentb7d2587f726a2295ae70d43a020b06f5de82c0d7 (diff)
ipv4: Restore flowi4_oif update before call to xfrm_lookup_route
[ Upstream commit 874fb9e2ca949b443cc419a4f2227cafd4381d39 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 7a5f64cf1fdd..a293d4968d1e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2728,10 +2728,12 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
if (IS_ERR(rt))
return rt;
- if (flp4->flowi4_proto)
+ if (flp4->flowi4_proto) {
+ flp4->flowi4_oif = rt->dst.dev->ifindex;
rt = (struct rtable *)xfrm_lookup_route(net, &rt->dst,
flowi4_to_flowi(flp4),
sk, 0);
+ }
return rt;
}