From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: shemminger@linux-foundation.org
Cc: netdev@vger.kernel.org, yoshfuji@linux-ipv6.org,
yasuyuki.kozakai@toshiba.co.jp
Subject: [PATCH] IPROUTE2: Support IPv4/IPv6 Tunnel
Date: Fri, 12 Oct 2007 16:51:22 +0900 (JST) [thread overview]
Message-ID: <20071012.165122.05747470.yoshfuji@linux-ipv6.org> (raw)
Based on patch from Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index 6468d99..cbbdf9d 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -52,6 +52,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 | any } ]\n");
fprintf(stderr, " [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n");
fprintf(stderr, " [ encaplimit ELIM ]\n");
fprintf(stderr ," [ hoplimit HLIM ] [ tc TC ] [ fl FL ]\n");
@@ -116,7 +117,24 @@ static int parse_args(int argc, char **argv, struct ip6_tnl_parm *p)
memset(medium, 0, sizeof(medium));
while (argc > 0) {
- if (strcmp(*argv, "remote") == 0) {
+ if (strcmp(*argv, "mode") == 0) {
+ NEXT_ARG();
+ if (strcmp(*argv, "ipv6/ipv6") == 0 ||
+ strcmp(*argv, "ip6ip6") == 0)
+ p->proto = IPPROTO_IPV6;
+ else if (strcmp(*argv, "ip/ipv6") == 0 ||
+ strcmp(*argv, "ipv4/ipv6") == 0 ||
+ strcmp(*argv, "ipip6") == 0 ||
+ strcmp(*argv, "ip4ip6") == 0)
+ p->proto = IPPROTO_IPIP;
+ else if (strcmp(*argv, "any/ipv6") == 0 ||
+ strcmp(*argv, "any") == 0)
+ p->proto = 0;
+ else {
+ fprintf(stderr,"Cannot guess tunnel mode.\n");
+ exit(-1);
+ }
+ } else if (strcmp(*argv, "remote") == 0) {
inet_prefix raddr;
NEXT_ARG();
get_prefix(&raddr, *argv, preferred_family);
diff --git a/ip/tunnel.c b/ip/tunnel.c
index 5fede2c..104340d 100644
--- a/ip/tunnel.c
+++ b/ip/tunnel.c
@@ -51,6 +51,9 @@ const char *tnl_strproto(__u8 proto)
case IPPROTO_IPV6:
strcpy(buf, "ipv6");
break;
+ case 0:
+ strcpy(buf, "any");
+ break;
default:
strcpy(buf, "unknown");
break;
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
next reply other threads:[~2007-10-12 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 7:51 YOSHIFUJI Hideaki / 吉藤英明 [this message]
2007-10-12 20:12 ` [PATCH] IPROUTE2: Support IPv4/IPv6 Tunnel Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071012.165122.05747470.yoshfuji@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=yasuyuki.kozakai@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox