]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: prohibit to set MTUBytes= and UseMTU= simultaneously 9832/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Aug 2018 07:12:56 +0000 (16:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Aug 2018 07:14:56 +0000 (16:14 +0900)
man/systemd.network.xml
src/network/networkd-network.c

index cbf53f323abac9e5525596a07afeb1531e8d9195..31af7cfa9835fdc25525e400d857d9f60bf29566 100644 (file)
           <listitem>
             <para>When true, the interface maximum transmission unit
             from the DHCP server will be used on the current link.
+            If <varname>MTUBytes=</varname> is set, then this setting is ignored.
             Defaults to false.</para>
           </listitem>
         </varlistentry>
index 77ba8c678ee32dd0a9f5b54fb2144ebdaad45848..c61614f1c8d448c34e976b30b1fd83a1a55ed8bd 100644 (file)
@@ -281,6 +281,12 @@ static int network_load_one(Manager *manager, const char *filename) {
         if (network->ip_masquerade)
                 network->ip_forward |= ADDRESS_FAMILY_IPV4;
 
+        if (network->mtu > 0 && network->dhcp_use_mtu) {
+                log_warning("MTUBytes= in [Link] section and UseMTU= in [DHCP] section are set in %s. "
+                            "Disabling UseMTU=.", filename);
+                network->dhcp_use_mtu = false;
+        }
+
         LIST_PREPEND(networks, manager->networks, network);
 
         r = hashmap_ensure_allocated(&manager->networks_by_name, &string_hash_ops);