diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-20 18:10:08 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-08-04 13:45:59 +0200 |
commit | 82da29746d8c9fa45a6baba369327a0e9fa0dfdd (patch) | |
tree | f09e039ca17c577c048bbe03649096ad41a82786 | |
parent | 375100715f5d530ce69d83272f6134f50ea89f76 (diff) | |
download | NetworkManager-82da29746d8c9fa45a6baba369327a0e9fa0dfdd.tar.gz |
device: don't modify the device MTU if it's unset
The MTU of 0 means default, not zero-length packets:
<warn> (wlp3s0): Lowering IPv6 MTU (1472) to match device MTU (0)
<warn> (wlp3s0): IPv6 MTU (0) smaller than 1280, adjusting
<warn> (wlp3s0): Raising device MTU (0) to match IPv6 MTU (1280)
<error> [1437068831.306733] [platform/nm-linux-platform.c:2440] sysctl_set(): platform-linux: sysctl: failed to set '/proc/sys/net/ipv6/conf/wlp3s0/mtu' to '1472': (22) Invalid argument
Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=752508
(cherry picked from commit a92d8b0c678e17d1cc175c3aad50afb1443785d2)
-rw-r--r-- | src/devices/nm-device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 223965de96..966cbf5002 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4492,19 +4492,19 @@ nm_device_ipv6_set_mtu (NMDevice *self, guint32 mtu) priv->ip6_mtu = mtu ?: plat_mtu; - if (priv->ip6_mtu && priv->mtu < priv->ip6_mtu) { + if (priv->ip6_mtu && priv->mtu && priv->mtu < priv->ip6_mtu) { _LOGW (LOGD_DEVICE | LOGD_IP6, "Lowering IPv6 MTU (%d) to match device MTU (%d)", priv->ip6_mtu, priv->mtu); priv->ip6_mtu = priv->mtu; } - if (priv->ip6_mtu < 1280) { + if (priv->ip6_mtu && priv->ip6_mtu < 1280) { _LOGW (LOGD_DEVICE | LOGD_IP6, "IPv6 MTU (%d) smaller than 1280, adjusting", priv->ip6_mtu); priv->ip6_mtu = 1280; } - if (priv->mtu < priv->ip6_mtu) { + if (priv->ip6_mtu && priv->mtu && priv->mtu < priv->ip6_mtu) { _LOGW (LOGD_DEVICE | LOGD_IP6, "Raising device MTU (%d) to match IPv6 MTU (%d)", priv->mtu, priv->ip6_mtu); nm_device_set_mtu (self, priv->ip6_mtu); |