diff options
author | Haishuang Yan <yanhaishuang@cmss.chinamobile.com> | 2016-05-21 13:17:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-25 00:33:48 +0300 |
commit | 1b227e536662eae4b7beee3037edbecdc577495f (patch) | |
tree | 63e240aac0a2198bb5f16014c2f91b0edd0ae56f /net/ipv6/ip6_gre.c | |
parent | 54b9430f04b0be3beb7f2711152c61e7d39c58e5 (diff) | |
download | linux-1b227e536662eae4b7beee3037edbecdc577495f.tar.xz |
ip6_gre: Fix MTU setting for ip6gretap
When creat an ip6gretap interface with an unreachable route,
the MTU is about 14 bytes larger than what was needed.
If the remote address is reachable:
ping6 2001:0:130::1 -c 2
PING 2001:0:130::1(2001:0:130::1) 56 data bytes
64 bytes from 2001:0:130::1: icmp_seq=1 ttl=64 time=1.46 ms
64 bytes from 2001:0:130::1: icmp_seq=2 ttl=64 time=81.1 ms
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r-- | net/ipv6/ip6_gre.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index af503f518278..a6fe3397728c 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -1027,6 +1027,8 @@ static int ip6gre_tunnel_init_common(struct net_device *dev) dev->hard_header_len = LL_MAX_HEADER + t_hlen; dev->mtu = ETH_DATA_LEN - t_hlen; + if (dev->type == ARPHRD_ETHER) + dev->mtu -= ETH_HLEN; if (!(tunnel->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) dev->mtu -= 8; |