iproute2: Add support for IPv6 VTI tunnels to ip6tunnel
Subsystems (2)
PATCH 1/2 iproute2: Add support for IPv6 VTI tunnels to ip6tunnel
--- ip/ip6tunnel.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
ip/ip6tunnel.c +12 -3
@@ -47,7 +47,7 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) {fprintf (stderr,"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" ); -fprintf (stderr," [ mode { ip6ip6 | ipip6 | ip6gre | any } ]\n" ); +fprintf (stderr," [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" );fprintf (stderr," [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" );fprintf (stderr," [ encaplimit ELIM ]\n" );fprintf (stderr ," [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" );
@@ -140,7 +140,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)if (strcmp (*argv,"ipv6/ipv6" ) ==0 ||strcmp (*argv,"ip6ip6" ) ==0 ) p->proto =IPPROTO_IPV6 ; -else if (strcmp (*argv,"ip/ipv6" ) ==0 || +else if (strcmp (*argv,"vti6" ) ==0 ) { + p->proto =IPPROTO_IPV6 ; + p->i_flags |=VTI_ISVTI ; + }else if (strcmp (*argv,"ip/ipv6" ) ==0 ||strcmp (*argv,"ipv4/ipv6" ) ==0 ||strcmp (*argv,"ipip6" ) ==0 ||strcmp (*argv,"ip4ip6" ) ==0 )
@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_add_ioctl (cmd,"ip6_vti0" , p.name, &p); +else return tnl_add_ioctl (cmd,"ip6tnl0" , p.name, &p);case IPPROTO_GRE :return tnl_add_ioctl (cmd,"ip6gre0" , p.name, &p);default : -fprintf (stderr,"cannot determine tunnel mode (ip6ip6, ipip6 or gre)\n" ); +fprintf (stderr,"cannot determine tunnel mode (ip6ip6, ipip6, vti6 or gre)\n" ); }return -1 ; }
@@ -480,6 +486,9 @@ static int do_del(int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_del_ioctl ("ip6_vti0" , p.name, &p); +else return tnl_del_ioctl ("ip6tnl0" , p.name, &p);case IPPROTO_GRE :return tnl_del_ioctl ("ip6gre0" , p.name, &p);
Signature · 1 line
1.9.1
PATCH 2/2 iproute2: VTI6 support for ip -6 link command.
--- ip/Makefile | 2 +- ip/link_vti6.c | 250 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 ip/link_vti6.c
ip/Makefile +1 -1
@@ -3,7 +3,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \ ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \ ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \ iplink_vlan.o link_veth.o link_gre.o iplink_can.o \ - iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o \ + iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o link_vti6.o \ iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \ link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o
ip/link_vti6.c new file +250 -0
250 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 32 lines · Fri, Sep 26, 2014 at 09:10:56AM CEST, [email protected] wrote:
Signed-off-by Steffen Klassert <[email protected]>---
ip/ip6tunnel.c| 15 ++++++++++++---1 file changed, 12 insertions(+), 3 deletions(-)ip/ip6tunnel.c +5
-2@@ -47,7 +47,7 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) {fprintf (stderr,"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" ); -fprintf (stderr," [ mode { ip6ip6 | ipip6 | ip6gre | any } ]\n" ); +fprintf (stderr," [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" );fprintf (stderr," [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" );fprintf (stderr," [ encaplimit ELIM ]\n" );fprintf (stderr ," [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" );@@ -140,7 +140,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)if (strcmp (*argv,"ipv6/ipv6" ) ==0 ||strcmp (*argv,"ip6ip6" ) ==0 ) p->proto =IPPROTO_IPV6 ; -else if (strcmp (*argv,"ip/ipv6" ) ==0 || +else if (strcmp (*argv,"vti6" ) ==0 ) { + p->proto =IPPROTO_IPV6 ; + p->i_flags |=VTI_ISVTI ; + }else if (strcmp (*argv,"ip/ipv6" ) ==0 ||strcmp (*argv,"ipv4/ipv6" ) ==0 ||strcmp (*argv,"ipip6" ) ==0 ||strcmp (*argv,"ip4ip6" ) ==0 )
ip/ip6tunnel.c static int do_add(int cmd, int argc, char **argv) · line 466
Quoted 5 lines
ip/ip6tunnel.c +2
-0@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_add_ioctl (cmd,"ip6_vti0" , p.name, &p);
^ Wouldn't it be more consistent to not to use the underscore?
Quoted 27 lines
ip/ip6tunnel.c +5
-1+else return tnl_add_ioctl (cmd,"ip6tnl0" , p.name, &p);case IPPROTO_GRE :return tnl_add_ioctl (cmd,"ip6gre0" , p.name, &p);default : -fprintf (stderr,"cannot determine tunnel mode (ip6ip6, ipip6 or gre)\n" ); +fprintf (stderr,"cannot determine tunnel mode (ip6ip6, ipip6, vti6 or gre)\n" ); }return -1 ; }@@ -480,6 +486,9 @@ static int do_del(int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_del_ioctl ("ip6_vti0" , p.name, &p); +else return tnl_del_ioctl ("ip6tnl0" , p.name, &p);case IPPROTO_GRE :return tnl_del_ioctl ("ip6gre0" , p.name, &p);Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Jiri Pirko
ip/ip6tunnel.c static int do_add(int cmd, int argc, char **argv) · line 466
Quoted 7 lines · Fri, Sep 26, 2014 at 09:10:56AM CEST, [email protected] wrote:
ip/ip6tunnel.c +2
-0@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_add_ioctl (cmd,"ip6_vti0" , p.name, &p);^ Wouldn't it be more consistent to not to use the underscore?
The ipv4 version of vti uses ip_vti0, so I tried to be consistent with that.
Quoted 13 lines · Thu, Oct 02, 2014 at 10:48:20AM CEST, [email protected] wrote:
Quoted 11 lines · Jiri Pirko
ip/ip6tunnel.c static int do_add(int cmd, int argc, char **argv) · line 466
Quoted 7 lines · Fri, Sep 26, 2014 at 09:10:56AM CEST, [email protected] wrote:
ip/ip6tunnel.c +2
-0@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_add_ioctl (cmd,"ip6_vti0" , p.name, &p);^ Wouldn't it be more consistent to not to use the underscore?
Quoted 2 lines
The ipv4 version of vti uses
ip_vti0, so I tried to be consistent with that.
Okay, fine with me.
Quoted 14 lines · On Thu, 2 Oct 2014 11:11:40 +0200 Jiri Pirko <[email protected]> wrote:
Quoted 13 lines · Thu, Oct 02, 2014 at 10:48:20AM CEST, [email protected] wrote:
Quoted 11 lines · Jiri Pirko
ip/ip6tunnel.c static int do_add(int cmd, int argc, char **argv) · line 466
Quoted 7 lines · Fri, Sep 26, 2014 at 09:10:56AM CEST, [email protected] wrote:
ip/ip6tunnel.c +2
-0@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)switch (p.proto) {case IPPROTO_IPIP :case IPPROTO_IPV6 : +if (p.i_flags !=VTI_ISVTI ) +return tnl_add_ioctl (cmd,"ip6_vti0" , p.name, &p);^ Wouldn't it be more consistent to not to use the underscore?
Quoted 4 lines
Quoted 2 lines
The ipv4 version of vti uses
ip_vti0, so I tried to be consistent with that.Okay, fine with me.
Sure, applied.