diff -rup systemd-239/src/network/networkd-link.c systemd-239-new/src/network/networkd-link.c --- systemd-239/src/network/networkd-link.c 2018-06-22 04:11:49.000000000 -0700 +++ systemd-239-new/src/network/networkd-link.c 2018-10-26 04:55:28.249268475 -0700 @@ -1304,24 +1304,6 @@ int link_set_mtu(Link *link, uint32_t mt if (r < 0) return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m"); - /* If IPv6 not configured (no static IPv6 address and IPv6LL autoconfiguration is disabled) - for this interface, or if it is a bridge slave, then disable IPv6 else enable it. */ - (void) link_enable_ipv6(link); - - /* IPv6 protocol requires a minimum MTU of IPV6_MTU_MIN(1280) bytes - on the interface. Bump up MTU bytes to IPV6_MTU_MIN. */ - if (link_ipv6_enabled(link) && link->network->mtu < IPV6_MIN_MTU) { - - log_link_warning(link, "Bumping MTU to " STRINGIFY(IPV6_MIN_MTU) ", as " - "IPv6 is requested and requires a minimum MTU of " STRINGIFY(IPV6_MIN_MTU) " bytes: %m"); - - link->network->mtu = IPV6_MIN_MTU; - } - - r = sd_netlink_message_append_u32(req, IFLA_MTU, link->network->mtu); - if (r < 0) - return log_link_error_errno(link, r, "Could not set MTU: %m"); - r = sd_netlink_message_append_u32(req, IFLA_MTU, mtu); if (r < 0) return log_link_error_errno(link, r, "Could not append MTU: %m"); @@ -1789,6 +1771,26 @@ int link_up(Link *link) { return log_link_error_errno(link, r, "Could not set MAC address: %m"); } + /* If IPv6 not configured (no static IPv6 address and IPv6LL autoconfiguration is disabled) + for this interface, or if it is a bridge slave, then disable IPv6 else enable it. */ + (void) link_enable_ipv6(link); + + if (link->network->mtu != 0) { + /* IPv6 protocol requires a minimum MTU of IPV6_MTU_MIN(1280) bytes + on the interface. Bump up MTU bytes to IPV6_MTU_MIN. */ + if (link_ipv6_enabled(link) && link->network->mtu < IPV6_MIN_MTU) { + + log_link_warning(link, "Bumping MTU to " STRINGIFY(IPV6_MIN_MTU) ", as " + "IPv6 is requested and requires a minimum MTU of " STRINGIFY(IPV6_MIN_MTU) " bytes: %m"); + + link->network->mtu = IPV6_MIN_MTU; + } + + r = sd_netlink_message_append_u32(req, IFLA_MTU, link->network->mtu); + if (r < 0) + return log_link_error_errno(link, r, "Could not set MTU: %m"); + } + r = sd_netlink_message_open_container(req, IFLA_AF_SPEC); if (r < 0) return log_link_error_errno(link, r, "Could not open IFLA_AF_SPEC container: %m"); @@ -2861,12 +2863,6 @@ static int link_configure(Link *link) { if (r < 0) return r; } - - if (link->network->mtu > 0) { - r = link_set_mtu(link, link->network->mtu); - if (r < 0) - return r; - } if (link_has_carrier(link) || link->network->configure_without_carrier) { r = link_acquire_conf(link); Only in systemd-239-new/src/network: networkd-link.c.orig