diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2018-05-31 10:59:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-01 13:56:30 -0400 |
commit | f7ff1fde9441b4fcc8ffb6e66e6e5a00d008937e (patch) | |
tree | 9b7dc697f33e0231c1b64ac3c65f3de76deffd34 /net/ipv6/ip6_tunnel.c | |
parent | 82612de1c98e610d194e34178bde3cca7dedce41 (diff) | |
download | linux-stable-f7ff1fde9441b4fcc8ffb6e66e6e5a00d008937e.tar.gz linux-stable-f7ff1fde9441b4fcc8ffb6e66e6e5a00d008937e.tar.bz2 linux-stable-f7ff1fde9441b4fcc8ffb6e66e6e5a00d008937e.zip |
ip6_tunnel: remove magic mtu value 0xFFF8
I don't know where this value comes from (probably a copy and paste and
paste and paste ...).
Let's use standard values which are a bit greater.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index da66aaac51ce..00e138a44cbb 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1692,8 +1692,13 @@ int ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) if (new_mtu < ETH_MIN_MTU) return -EINVAL; } - if (new_mtu > 0xFFF8 - dev->hard_header_len) - return -EINVAL; + if (tnl->parms.proto == IPPROTO_IPV6 || tnl->parms.proto == 0) { + if (new_mtu > IP6_MAX_MTU - dev->hard_header_len) + return -EINVAL; + } else { + if (new_mtu > IP_MAX_MTU - dev->hard_header_len) + return -EINVAL; + } dev->mtu = new_mtu; return 0; } @@ -1841,7 +1846,7 @@ ip6_tnl_dev_init_gen(struct net_device *dev) if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) dev->mtu -= 8; dev->min_mtu = ETH_MIN_MTU; - dev->max_mtu = 0xFFF8 - dev->hard_header_len; + dev->max_mtu = IP6_MAX_MTU - dev->hard_header_len; return 0; |