]> git.baikalelectronics.ru Git - kernel.git/commit
ip6_gre: Fix MTU setting
authorTom Herbert <tom@herbertland.com>
Tue, 10 May 2016 00:12:08 +0000 (17:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 May 2016 04:39:27 +0000 (00:39 -0400)
commit8fe2bab3267f264213f7a67069ad18e56c94c2fa
treeef6c5a38b5a944b9588b967f98715cc77b090654
parenteb6baf90ee24f5f2d1ccb3cb8e6f3b65b0ce2512
ip6_gre: Fix MTU setting

In ip6gre_tnl_link_config set t->tun_len and t->hlen correctly for the
configuration. For hard_header_len and mtu calculation include
IPv6 header and encapsulation overhead.

In ip6gre_tunnel_init_common set t->tun_len and t->hlen correctly for
the configuration. Revert to setting hard_header_len instead of
needed_headroom.

Tested:

./ip link add name tun8 type ip6gretap remote \
2401:db00:20:911a:face:0:27:0 local \
2401:db00:20:911a:face:0:25:0 ttl 225

Gives MTU of 1434. That is equal to 1500 - 40 - 14 - 4 - 8.

./ip link add name tun8 type ip6gretap remote \
2401:db00:20:911a:face:0:27:0 local \
2401:db00:20:911a:face:0:25:0 ttl 225 okey 123

Gives MTU of 1430. That is equal to 1500 - 40 - 14 - 4 - 8 - 4.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c