From 32417c172383847ec78b672c537594e3efe8f0e0 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Fri, 30 Jan 2026 13:11:04 +0100 Subject: [PATCH] network: fix max MTU check for IPv6 MTU adjustments When link MTU is being adjusted in an IPv6 context (e.g., according to the MTU received in an RA), the new MTU is clamped against link's current MTU than link's max MTU. This means that the link MTU can never be increased via an RA: systemd-networkd[10068]: eth1: Reducing requested IPv6 MTU 8900 to the interface's maximum MTU 1500. systemd-networkd[10068]: Setting '/proc/sys/net/ipv6/conf/eth1/mtu' to '1500' systemd-networkd[10068]: No change in value '1500', suppressing write Fix this check to make logical sense, and also to match a similar check in src/network/networkd-setlink.c:link_adjust_mtu(). --- src/network/networkd-sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c index 92be8dfc8d..914fbccd09 100644 --- a/src/network/networkd-sysctl.c +++ b/src/network/networkd-sysctl.c @@ -545,11 +545,11 @@ int link_set_ipv6_mtu(Link *link, int log_level) { if (mtu == 0) return 0; - if (mtu > link->mtu) { + if (mtu > link->max_mtu) { log_link_full(link, log_level, "Reducing requested IPv6 MTU %"PRIu32" to the interface's maximum MTU %"PRIu32".", - mtu, link->mtu); - mtu = link->mtu; + mtu, link->max_mtu); + mtu = link->max_mtu; } r = sysctl_write_ip_property_uint32(AF_INET6, link->ifname, "mtu", mtu, manager_get_sysctl_shadow(link->manager));