• Petr Machata's avatar
    net: ip6_gre: Fix ip6erspan hlen calculation · 2d665034
    Petr Machata authored
    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: 5a963eb6 ("ip6_gre: Add ERSPAN native tunnel support")
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Acked-by: default avatarWilliam Tu <u9012063@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2d665034
ip6_gre.c 55.4 KB