• X
    ip_gre: add the support for i/o_flags update via netlink · dd9d598c
    Xin Long 提交于
    Now ip_gre is using ip_tunnel_changelink to update it's properties, but
    ip_tunnel_changelink in ip_tunnel doesn't update i/o_flags as a common
    function.
    
    o_flags updates would cause that tunnel->tun_hlen / hlen and dev->mtu /
    needed_headroom need to be recalculated, and dev->(hw_)features need to
    be updated as well.
    
    Therefore, we can't just add the update into ip_tunnel_update called
    in ip_tunnel_changelink, and it's also better not to touch ip_tunnel
    codes.
    
    This patch updates i/o_flags and calls ipgre_link_update to recalculate
    these gre properties after ip_tunnel_changelink does the common update.
    
    Note that since ipgre_link_update doesn't know the lower dev, it will
    update gre->hlen, dev->mtu and dev->needed_headroom with the value of
    'new tun_hlen - old tun_hlen'. In this way, we can avoid many redundant
    codes, unlike ip6_gre.
    Reported-by: NJianlin Shi <jishi@redhat.com>
    Signed-off-by: NXin Long <lucien.xin@gmail.com>
    Acked-by: NWilliam Tu <u9012063@gmail.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    dd9d598c
ip_gre.c 43.1 KB