summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-01-16 14:58:11 +0100
committerThomas Haller <thaller@redhat.com>2017-01-16 15:06:40 +0100
commit0559242521f32d8a40a0dcedeaa312714f6b8f6f (patch)
tree4325013a542032d381057135e2532aeaf5235c94
parent58d4216257edfd5dd195ee7e8318a63548c33629 (diff)
downloadNetworkManager-th/device-mtu-bgo777251.tar.gz
device: enforce a link MTU of at least 1280 for connections with IPv6th/device-mtu-bgo777251
-rw-r--r--src/devices/nm-device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 295b29583d..dd34bda63e 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6659,6 +6659,22 @@ _commit_mtu (NMDevice *self, const NMIP4Config *config)
}
}
+ if (mtu_desired && mtu_desired < 1280) {
+ NMSettingIPConfig *s_ip6;
+
+ s_ip6 = (NMSettingIPConfig *) nm_device_get_applied_setting (self, NM_TYPE_SETTING_IP6_CONFIG);
+ if (s_ip6 && nm_streq0 (nm_setting_ip_config_get_method (s_ip6),
+ NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
+ /* the interface has IPv6 enabled. The MTU with IPv6 cannot be smaller
+ * then 1280.
+ *
+ * For slave-devices (that don't have @s_ip6 we) don't do this fixup because
+ * it's anyway an unsolved problem when the slave configures a conflicting
+ * MTU. */
+ mtu_desired = 1280;
+ }
+ }
+
ip6_mtu = priv->ip6_mtu;
if (!ip6_mtu && !priv->mtu_initialized) {
/* initially, if the IPv6 MTU is not specified, grow it as large as the