Hello list,

I think I have found a regression in 4.15+ kernels. IPv6 PMTU discovery doesn't seem to work with source-specific routing (AKA source-address dependent routing, SADR).

I made a test script (see attachment). It sets up a test environment with three network namespaces (a, b and c) using SADR. The link between b and c is configured with MTU 1280. It then runs a ping test with large packets.

I have tested a couple of kernels on Ubuntu 19.04 with the following results.

mainline 4.14.117-0414117-generic SUCCESS
ubuntu   4.15.0-1036-oem          FAIL
mainline 5.1.0-050100-generic     FAIL

The mainline kernels are from https://kernel.ubuntu.com/~kernel-ppa/mainline/, and the other from the Ubuntu 19.04 repository.

I have attached a patch against 5.1 which seems to fix the problem in the test case.

It's bug #1788623 in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1788623

/Mikael
>From 4dd6d3e00663ec1749d8c6cf8139a2e255c7a797 Mon Sep 17 00:00:00 2001
From: Mikael Magnusson <mi...@users.sourceforge.net>
Date: Wed, 8 May 2019 22:06:44 +0000
Subject: [PATCH] net/ipv6/route: Fix PMTU for source-specific routes

---
 net/ipv6/route.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0520aca3354b..63d678588ec9 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1197,13 +1197,13 @@ static struct rt6_info *ip6_rt_cache_alloc(struct fib6_info *ort,
 		if (ort->fib6_dst.plen != 128 &&
 		    ipv6_addr_equal(&ort->fib6_dst.addr, daddr))
 			rt->rt6i_flags |= RTF_ANYCAST;
+	}
 #ifdef CONFIG_IPV6_SUBTREES
-		if (rt->rt6i_src.plen && saddr) {
-			rt->rt6i_src.addr = *saddr;
-			rt->rt6i_src.plen = 128;
-		}
-#endif
+	if (rt->rt6i_src.plen && saddr) {
+		rt->rt6i_src.addr = *saddr;
+		rt->rt6i_src.plen = 128;
 	}
+#endif
 
 	return rt;
 }
-- 
2.17.1


Attachment: pmtu-ns.sh
Description: application/shellscript

Reply via email to