TUNNEL: IPv6-over-IPv6 tunnel support.
Fix ip6tunnel.c to be fit with current ip command style.
Unlike other modules currently iptunnel (and ip6tunnel) is not
designed as protocol-independent because of unarranged structure
between IPv4 and IPv6.
Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]
[ remote ADDR local ADDR ] [ dev PHYS_DEV ]
[ encaplimit ELIM ]
[ hoplimit HLIM ] [ tc TC ] [ fl FL ]
[ dscp inherit ]
Where: NAME := STRING
ADDR := IPV6_ADDRESS
ELIM := { none | 0..255 }(default=4)
HLIM := 0..255 (default=64)
TC := { 0x0..0xff | inherit }
FL := { 0x0..0xfffff | inherit }
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 26ae30c..57a6ab0 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -31,6 +31,7 @@
#include "rt_names.h"
#include "utils.h"
+#include "ip_common.h"
#include "tunnel.h"
static void usage(void) __attribute__((noreturn));
@@ -455,6 +456,13 @@
break;
case AF_INET:
break;
+ /*
+ * This is silly enough but we have no easy way to make it
+ * protocol-independent because of unarranged structure between
+ * IPv4 and IPv6.
+ */
+ case AF_INET6:
+ return do_ip6tunnel(argc, argv);
default:
fprintf(stderr, "Unsupported family:%d\n", preferred_family);
exit(-1);