summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Kohmann <geokohma@cisco.com>2020-10-07 15:53:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-17 19:25:06 +0300
commitecdb232730f00a450f0623de5ac71b0b93c696fa (patch)
treef76ae09f4aec4b9fd607d36acb55bd1d00859f77
parentb2fdd7f1b6692402bf8b620bc78fd62d1eb8e13a (diff)
downloadlinux-ecdb232730f00a450f0623de5ac71b0b93c696fa.tar.xz
net: ipv6: Discard next-hop MTU less than minimum link MTU
commit 4a65dff81a04f874fa6915c7f069b4dc2c4010e4 upstream. When a ICMPV6_PKT_TOOBIG report a next-hop MTU that is less than the IPv6 minimum link MTU, the estimated path MTU is reduced to the minimum link MTU. This behaviour breaks TAHI IPv6 Core Conformance Test v6LC4.1.6: Packet Too Big Less than IPv6 MTU. Referring to RFC 8201 section 4: "If a node receives a Packet Too Big message reporting a next-hop MTU that is less than the IPv6 minimum link MTU, it must discard it. A node must not reduce its estimate of the Path MTU below the IPv6 minimum link MTU on receipt of a Packet Too Big message." Drop the path MTU update if reported MTU is less than the minimum link MTU. Signed-off-by: Georg Kohmann <geokohma@cisco.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: WangYuli <wangyuli@uniontech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ipv6/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b321cec71127..93bae134e730 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2765,7 +2765,8 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,
if (confirm_neigh)
dst_confirm_neigh(dst, daddr);
- mtu = max_t(u32, mtu, IPV6_MIN_MTU);
+ if (mtu < IPV6_MIN_MTU)
+ return;
if (mtu >= dst_mtu(dst))
return;