• William Dauchy's avatar
    net, ip6_tunnel: enhance tunnel locate with link check · 5fdcce21
    William Dauchy authored
    With ipip, it is possible to create an extra interface explicitly
    attached to a given physical interface:
    
      # ip link show tunl0
      4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
        link/ipip 0.0.0.0 brd 0.0.0.0
      # ip link add tunl1 type ipip dev eth0
      # ip link show tunl1
      6: tunl1@eth0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
        link/ipip 0.0.0.0 brd 0.0.0.0
    
    But it is not possible with ip6tnl:
    
      # ip link show ip6tnl0
      5: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/tunnel6 :: brd ::
      # ip link add ip6tnl1 type ip6tnl dev eth0
      RTNETLINK answers: File exists
    
    This patch aims to make it possible by adding link comparaison in both
    tunnel locate and lookup functions; we also modify mtu calculation when
    attached to an interface with a lower mtu.
    
    This permits to make use of x-netns communication by moving the newly
    created tunnel in a given netns.
    Signed-off-by: default avatarWilliam Dauchy <w.dauchy@criteo.com>
    Reviewed-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5fdcce21
ip6_tunnel.c 57.1 KB