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 17:30:12 +0100
commit665e3980221c04c327b3c165f4a3f82fe470e87e (patch)
tree06c948895d1ddc5ecbefd133d6bd5decef6777ea
parent22e8af6242853397e91f648458f23200f8fac178 (diff)
device: enforce a link MTU of at least 1280 for connections with IPv6
-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 911ebff64d..c236a85803 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6653,6 +6653,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