summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-route.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-01-20 07:55:06 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-01-20 14:17:26 +0100
commit1c62c4fe0b54fb419b875cb2bae82a261518a745 (patch)
tree1e1248250a46431775940000d6096b2fd83c5cc2 /src/network/networkd-route.c
parentMerge pull request #31004 from AdrianVovk/misc-cleanups (diff)
downloadsystemd-1c62c4fe0b54fb419b875cb2bae82a261518a745.tar.xz
systemd-1c62c4fe0b54fb419b875cb2bae82a261518a745.zip
network/route: update MTU of IPv6 route even if the kernel returns -EEXIST
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r--src/network/networkd-route.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index a142719fb7..05280a582f 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -874,6 +874,19 @@ int route_configure_handler_internal(sd_netlink *rtnl, sd_netlink_message *m, Li
* notification, so we need to update the timer here. */
existing->lifetime_usec = route->lifetime_usec;
(void) route_setup_timer(existing, NULL);
+
+ /* This may be a bug in the kernel, but the MTU of an IPv6 route can be updated only
+ * when the route has an expiration timer managed by the kernel (not by us).
+ * See fib6_add_rt2node() in net/ipv6/ip6_fib.c of the kernel. */
+ if (existing->family == AF_INET6 &&
+ existing->expiration_managed_by_kernel) {
+ r = route_metric_set(&existing->metric, RTAX_MTU, route_metric_get(&route->metric, RTAX_MTU));
+ if (r < 0) {
+ log_oom();
+ link_enter_failed(link);
+ return 0;
+ }
+ }
}
} else if (r < 0) {