netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv4: Restore flowi4_oif update before call to xfrm_lookup_route
@ 2020-10-09 18:01 David Ahern
  2020-10-10 18:42 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2020-10-09 18:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, David Ahern, Tobias Brunner

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>
---
 net/ipv4/route.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 58642b29a499..9bd30fd4de4b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2769,10 +2769,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;
 }
-- 
2.24.3 (Apple Git-128)


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

* Re: [PATCH net] ipv4: Restore flowi4_oif update before call to xfrm_lookup_route
  2020-10-09 18:01 [PATCH net] ipv4: Restore flowi4_oif update before call to xfrm_lookup_route David Ahern
@ 2020-10-10 18:42 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-10-10 18:42 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, davem, Tobias Brunner

On Fri,  9 Oct 2020 11:01:01 -0700 David Ahern wrote:
> 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>

Applied and queued for stable, thank you!

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

end of thread, other threads:[~2020-10-10 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 18:01 [PATCH net] ipv4: Restore flowi4_oif update before call to xfrm_lookup_route David Ahern
2020-10-10 18:42 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).