vti6: Keep set MTU on link creation or change, validate it
authorStefano Brivio <sbrivio@redhat.com>
Thu, 15 Mar 2018 16:17:12 +0000 (17:17 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 19 Mar 2018 07:45:50 +0000 (08:45 +0100)
commit7a67e69a339a6824be2fc483073782ab2f47fcd2
tree9ad2cfaf899bb8dddcd2b44da677bd5eae2693c4
parentc6741fbed6dc0f183d26c4b6bca4517672f92e6c
vti6: Keep set MTU on link creation or change, validate it

In vti6_link_config(), if MTU is already given on link creation
or change, validate and use it instead of recomputing it. To do
that, we need to propagate the knowledge that MTU was set by
userspace all the way down to vti6_link_config().

To keep this simple, vti6_dev_init() sets the new 'keep_mtu'
argument of vti6_link_config() to true: on initialization, we
don't have convenient access to netlink attributes there, but we
will anyway check whether dev->mtu is set in vti6_link_config().
If it's non-zero, it was set to the value of the IFLA_MTU
attribute during creation. Otherwise, determine a reasonable
value.

Fixes: ed1efb2aefbb ("ipv6: Add support for IPsec virtual tunnel interfaces")
Fixes: 53c81e95df17 ("ip6_vti: adjust vti mtu according to mtu of lower device")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv6/ip6_vti.c