summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2018-03-15 17:17:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-30 07:52:16 +0200
commitb57f0fe6e38b97dc3c2e3836010b8dc3373b1d58 (patch)
treedfb5f687b0c92ad212e692caabd26ae347e529cb /net/ipv6
parent5815901c29c2936d7acbed2683d5807b4ae53ede (diff)
vti6: Fix dev->max_mtu setting
[ Upstream commit f8a554b4aa9686bb2c12f6bae516e58783289a03 ] We shouldn't allow a tunnel to have IP_MAX_MTU as MTU, because another IPv6 header is going on top of our packets. Without this patch, we might end up building packets bigger than IP_MAX_MTU. Fixes: b96f9afee4eb ("ipv4/6: use core net MTU range checking") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Acked-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_vti.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index 2493a40bc4b1..0e0ab90a4334 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -852,7 +852,7 @@ static void vti6_dev_setup(struct net_device *dev)
dev->hard_header_len = LL_MAX_HEADER + sizeof(struct ipv6hdr);
dev->mtu = ETH_DATA_LEN;
dev->min_mtu = IPV6_MIN_MTU;
- dev->max_mtu = IP_MAX_MTU;
+ dev->max_mtu = IP_MAX_MTU - sizeof(struct ipv6hdr);
dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr);
netif_keep_dst(dev);