chiark / gitweb /
networkd: link - only save original MTU when necessary
authorTom Gundersen <teg@jklm.no>
Thu, 16 Jan 2014 14:09:57 +0000 (15:09 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 16 Jan 2014 19:32:08 +0000 (20:32 +0100)
src/network/networkd-link.c

index 8960b60..6e0139c 100644 (file)
@@ -828,9 +828,11 @@ int link_update(Link *link, sd_rtnl_message *m) {
         }
 
         while (sd_rtnl_message_read(m, &type, &data) > 0) {
-                if (type == IFLA_MTU && link->network->dhcp_mtu && !link->original_mtu) {
+                if (type == IFLA_MTU && link->network->dhcp &&
+                    link->network->dhcp_mtu && !link->original_mtu) {
                         link->original_mtu = *(uint16_t *) data;
-                        log_debug_link(link, "saved original MTU: %" PRIu16, link->original_mtu);
+                        log_debug_link(link, "saved original MTU: %" PRIu16,
+                                       link->original_mtu);
                 }
         }