lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 5 May 2009 12:50:50 +0200
From:	Alexandre Cassen <acassen@...ebox.fr>
To:	netdev@...r.kernel.org
Subject: [PATCH] IPv6: 6rd iproute2 support

IPv6 rapid deployment (6rd) builds upon mechanisms of 6to4 (RFC3056)
to enable a service provider to rapidly deploy IPv6 unicast service
to IPv4 sites to which it provides customer premise equipment.  Like
6to4, it utilizes stateless IPv6 in IPv4 encapsulation in order to
transit IPv4-only network infrastructure.  Unlike 6to4, a 6rd service
provider uses an IPv6 prefix of its own in place of the fixed 6to4
prefix. more info at http://tools.ietf.org/html/draft-despres-6rd-03.

Signed-off-by: Alexandre Cassen <acassen@...ebox.fr>
---
 include/linux/if_tunnel.h |    5 +++++
 ip/iptunnel.c             |   16 +++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 2918c6f..00092e0 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -30,6 +30,11 @@ struct ip_tunnel_parm
 	__be16			o_flags;
 	__be32			i_key;
 	__be32			o_key;
+
+	/* 6rd matching params */
+	struct in6_addr		ip6rd_zone;
+	__u8			ip6rd_prefix;
+
 	struct iphdr		iph;
 };
 
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 7bee162..8e08872 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -40,7 +40,7 @@ static void usage(void)
 {
 	fprintf(stderr, "Usage: ip tunnel { add | change | del | show } [ NAME ]\n");
 	fprintf(stderr, "          [ mode { ipip | gre | sit | isatap } ] [ remote ADDR ] [ local ADDR ]\n");
-	fprintf(stderr, "          [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n");
+	fprintf(stderr, "          [ [i|o]seq ] [ [i|o]key KEY ] [ 6rd_zone ADDR ] [ [i|o]csum ]\n");
 	fprintf(stderr, "          [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n");
 	fprintf(stderr, "\n");
 	fprintf(stderr, "Where: NAME := STRING\n");
@@ -156,6 +156,13 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
 			p->i_flags |= GRE_CSUM;
 		} else if (strcmp(*argv, "ocsum") == 0) {
 			p->o_flags |= GRE_CSUM;
+		} else if (strcmp(*argv, "6rd_zone") == 0) {
+			inet_prefix zone;
+			NEXT_ARG();
+			if (get_prefix(&zone, *argv, AF_INET6))
+				invarg("invalid 6rd_zone\n", *argv);
+			memcpy(&p->ip6rd_zone, zone.data, 16);
+			p->ip6rd_prefix = zone.bitlen;
 		} else if (strcmp(*argv, "nopmtudisc") == 0) {
 			p->iph.frag_off = 0;
 		} else if (strcmp(*argv, "pmtudisc") == 0) {
@@ -348,6 +355,13 @@ static void print_tunnel(struct ip_tunnel_parm *p)
 	if (!(p->iph.frag_off&htons(IP_DF)))
 		printf(" nopmtudisc");
 
+	if (p->ip6rd_prefix) {
+		char buf[128];
+		printf(" 6rd_zone %s/%u ",
+		       inet_ntop(AF_INET6, &p->ip6rd_zone, buf, 128),
+		       p->ip6rd_prefix);
+	}
+
 	if ((p->i_flags&GRE_KEY) && (p->o_flags&GRE_KEY) && p->o_key == p->i_key)
 		printf(" key %s", s3);
 	else if ((p->i_flags|p->o_flags)&GRE_KEY) {
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists