diff -Nru systemd-232/debian/changelog systemd-232/debian/changelog --- systemd-232/debian/changelog 2017-03-02 02:21:12.000000000 -0600 +++ systemd-232/debian/changelog 2017-03-10 16:08:02.000000000 -0600 @@ -1,3 +1,9 @@ +systemd (232-19ubuntu1) zesty; urgency=medium + + * Enable IPV6 MTU configuration in .network files (LP: #1671951) + + -- Ryan Harper Fri, 10 Mar 2017 15:58:18 -0600 + systemd (232-19) unstable; urgency=medium [ Martin Pitt ] diff -Nru systemd-232/debian/patches/ipv6-mtu-refresh.patch systemd-232/debian/patches/ipv6-mtu-refresh.patch --- systemd-232/debian/patches/ipv6-mtu-refresh.patch 1969-12-31 18:00:00.000000000 -0600 +++ systemd-232/debian/patches/ipv6-mtu-refresh.patch 2017-03-10 16:04:33.000000000 -0600 @@ -0,0 +1,156 @@ +Description: networkd: add configuration for IPV6 MTU +Author: Susant Sahani +Bug-Ubuntu: +Origin: https://github.com/systemd/systemd/pull/1533 +Last-Update: 20170310 + +--- a/man/systemd.network.xml ++++ b/man/systemd.network.xml +@@ -594,6 +594,12 @@ + + + ++ IPv6MTUBytes= ++ Configures IPv6 maximum transmission unit (MTU). ++ An integer greater than or equal to 1280 bytes. Defaults to unset. ++ ++ ++ + Bridge= + + The name of the bridge to add the link to. +--- a/src/network/networkd-link.c ++++ b/src/network/networkd-link.c +@@ -2452,6 +2452,33 @@ + return r; + } + ++static int link_set_ipv6_mtu(Link *link) { ++ char buf[DECIMAL_STR_MAX(unsigned) + 1]; ++ const char *p = NULL; ++ int r; ++ ++ /* Make this a NOP if IPv6 is not available */ ++ if (!socket_ipv6_is_supported()) ++ return 0; ++ ++ if (link->flags & IFF_LOOPBACK) ++ return 0; ++ ++ if (link->network->ipv6_mtu == 0) ++ return 0; ++ ++ p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/mtu"); ++ ++ xsprintf(buf, "%u", link->network->ipv6_mtu); ++ ++ r = write_string_file(p, buf, 0); ++ if (r < 0) { ++ log_link_warning_errno(link, r, "Cannot set IPv6 MTU for interface: %m"); ++ } ++ ++ return 0; ++} ++ + static int link_configure(Link *link) { + int r; + +@@ -2512,6 +2539,10 @@ + if (r < 0) + return r; + ++ r = link_set_ipv6_mtu(link); ++ if (r < 0) ++ return r; ++ + if (link_ipv4ll_enabled(link)) { + r = ipv4ll_configure(link); + if (r < 0) +--- a/src/network/networkd-network-gperf.gperf ++++ b/src/network/networkd-network-gperf.gperf +@@ -50,6 +50,7 @@ + Network.Gateway, config_parse_gateway, 0, 0 + Network.Domains, config_parse_domains, 0, 0 + Network.DNS, config_parse_dns, 0, 0 ++Network.IPv6MTUBytes, config_parse_ipv6_mtu, 0, offsetof(Network, ipv6_mtu) + Network.LLMNR, config_parse_resolve_support, 0, offsetof(Network, llmnr) + Network.MulticastDNS, config_parse_resolve_support, 0, offsetof(Network, mdns) + Network.DNSSEC, config_parse_dnssec_mode, 0, offsetof(Network, dnssec_mode) +--- a/src/network/networkd-network.c ++++ b/src/network/networkd-network.c +@@ -134,6 +134,7 @@ + network->ipv6_accept_ra = -1; + network->ipv6_dad_transmits = -1; + network->ipv6_hop_limit = -1; ++ network->ipv6_mtu = -1; + network->duid.type = _DUID_TYPE_INVALID; + network->proxy_arp = -1; + network->arp = -1; +@@ -850,6 +851,39 @@ + return 0; + } + ++ ++int config_parse_ipv6_mtu( ++ const char *unit, ++ const char *filename, ++ unsigned line, ++ const char *section, ++ unsigned section_line, ++ const char *lvalue, ++ int ltype, ++ const char *rvalue, ++ void *data, ++ void *userdata) { ++ ++ int *mtu = data; ++ int k, r; ++ ++ assert(filename); ++ assert(lvalue); ++ assert(rvalue); ++ ++ r = config_parse_int(unit, filename, line, section, section_line, lvalue, ltype, rvalue, &k, userdata); ++ if (r < 0) ++ return r; ++ ++ if (k < IPV6_MIN_MTU) { ++ log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse IPv6 MTU for interface. Allowed minimum MTU is 1280 bytes ignoring: %s", rvalue); ++ return 0; ++ } ++ ++ *mtu = k; ++ ++ return 0; ++} + int config_parse_timezone( + const char *unit, + const char *filename, +--- a/src/network/networkd-network.h ++++ b/src/network/networkd-network.h +@@ -41,6 +41,8 @@ + #define BRIDGE_VLAN_BITMAP_MAX 4096 + #define BRIDGE_VLAN_BITMAP_LEN (BRIDGE_VLAN_BITMAP_MAX / 32) + ++#define IPV6_MIN_MTU 1280 ++ + typedef enum DCHPClientIdentifier { + DHCP_CLIENT_ID_MAC, + DHCP_CLIENT_ID_DUID, +@@ -118,6 +120,8 @@ + bool dhcp_use_hostname; + DHCPUseDomains dhcp_use_domains; + bool dhcp_send_hostname; ++ unsigned ipv6_mtu; ++ + bool dhcp_broadcast; + bool dhcp_critical; + bool dhcp_use_routes; +@@ -224,6 +228,7 @@ + int config_parse_dhcp_client_identifier(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_ipv6token(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_ipv6_privacy_extensions(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); ++int config_parse_ipv6_mtu(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_hostname(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_timezone(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_dhcp_server_dns(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); diff -Nru systemd-232/debian/patches/series systemd-232/debian/patches/series --- systemd-232/debian/patches/series 2017-03-02 02:21:12.000000000 -0600 +++ systemd-232/debian/patches/series 2017-03-10 13:02:17.000000000 -0600 @@ -73,3 +73,4 @@ debian/Revert-core-enable-TasksMax-for-all-services-by-default-a.patch debian/Let-graphical-session-pre.target-be-manually-started.patch debian/Add-env-variable-for-machine-ID-path.patch +ipv6-mtu-refresh.patch