summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-04-26 10:49:21 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-05-06 10:47:28 +0200
commite738479bdd714f754aa311bada3315147efab376 (patch)
tree43336e27fc5cef98d213638fc71c5a9e9accfac6
parentd80818e6cad94def1402be8326274bde998aa276 (diff)
downloadNetworkManager-e738479bdd714f754aa311bada3315147efab376.tar.gz
device: fix reapply of MTU
When we set the MTU on the link we remember its previous source (ip-config, parent-device or connection profile) and don't change it again afterwards to avoid interfering with user's manual changes. The only exceptions when we change it again are (1) if the parent device MTU changes and (2) if the new MTU has higher priority than the one previously set. To allow a live reapply of the MTU property we also need to clear the saved source, or the checks described above will prevent setting the new value. Fixes: 2f8917237fdf ('device: rework mtu priority handling') https://bugzilla.redhat.com/show_bug.cgi?id=1702657 (cherry picked from commit 4ed72fa658c03790700ba9084e9328fe38afdee9)
-rw-r--r--src/devices/nm-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index bd4fbcc37f..66513a69a4 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -11312,6 +11312,9 @@ check_and_reapply_connection (NMDevice *self,
s_ip6_old = nm_connection_get_setting_ip6_config (con_old);
s_ip6_new = nm_connection_get_setting_ip6_config (con_new);
+ /* Allow reapply of MTU */
+ priv->mtu_source = NM_DEVICE_MTU_SOURCE_NONE;
+
nm_device_reactivate_ip4_config (self, s_ip4_old, s_ip4_new);
nm_device_reactivate_ip6_config (self, s_ip6_old, s_ip6_new);