summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2021-05-13 14:40:10 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2021-05-17 16:20:36 +0200
commite67ddd826fae1a348a7a253e9c37744c05645112 (patch)
tree78a469df6cc2881416529af69ed5b237ce8394de
parentaeea0203b4e955fb823d8008753267c5793e4973 (diff)
downloadNetworkManager-bg/rh1890234.tar.gz
device: commit MTU during stage2bg/rh1890234
Currently we commit the MTU to the device when updating the IP configuration, or when a port device is added to the controller. This means that for a connection with DHCP, the MTU is set only after DHCP has completed. In particular, if DHCP doesn't complete and the connection has an infinite timeout, the MTU is never set. _commit_mtu() tracks different sources for the MTU of a device, and each source has a different priority. Among these sources there are the parent link (for VLANs), a dynamic IP configuration (DHCP, PPP) and the connection profile. A MTU from the connection always has the highest priority and overrides other sources. Therefore, if the connection specifies an MTU it can be applied at stage2, even before configuring IP addressing. https://bugzilla.redhat.com/show_bug.cgi?id=1890234 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/859
-rw-r--r--src/core/devices/nm-device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 14a47a013c..92f37f2f52 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -8468,6 +8468,8 @@ activate_stage2_device_config(NMDevice *self)
lldp_setup(self, NM_TERNARY_DEFAULT);
+ _commit_mtu(self, NULL);
+
nm_device_activate_schedule_stage3_ip_config_start(self);
}