net: ip6_gre: Fix ip6erspan hlen calculation
authorPetr Machata <petrm@mellanox.com>
Thu, 17 May 2018 14:36:51 +0000 (16:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 May 2018 20:50:06 +0000 (16:50 -0400)
commit2d665034f239412927b1e71329f20f001c92da09
tree69b5c67423f30b1a6dccb2c152a15fec0195d19b
parentc8632fc30bb03aa0c3bd7bcce85355a10feb8149
net: ip6_gre: Fix ip6erspan hlen calculation

Even though ip6erspan_tap_init() sets up hlen and tun_hlen according to
what ERSPAN needs, it goes ahead to call ip6gre_tnl_link_config() which
overwrites these settings with GRE-specific ones.

Similarly for changelink callbacks, which are handled by
ip6gre_changelink() calls ip6gre_tnl_change() calls
ip6gre_tnl_link_config() as well.

The difference ends up being 12 vs. 20 bytes, and this is generally not
a problem, because a 12-byte request likely ends up allocating more and
the extra 8 bytes are thus available. However correct it is not.

So replace the newlink and changelink callbacks with an ERSPAN-specific
ones, reusing the newly-introduced _common() functions.

Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c