[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <39C363776A4E8C4A94691D2BD9D1C9A1029EDBE3@XCH-NW-7V2.nw.nos.boeing.com>
Date: Tue, 6 Nov 2007 17:16:04 -0800
From: "Templin, Fred L" <Fred.L.Templin@...ing.com>
To: <netdev@...r.kernel.org>
Subject: [PATCH 02/05] ipv6: RFC4214 Support
From: Fred L. Templin <fred.l.templin@...ing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@...ing.com>
---
--- linux-2.6.23/include/net/addrconf.h.orig 2007-10-09
13:31:38.000000000 -0700
+++ linux-2.6.23/include/net/addrconf.h 2007-10-26 10:49:40.000000000
-0700
@@ -241,6 +241,34 @@ static inline int ipv6_addr_is_ll_all_ro
addr->s6_addr32[3] == htonl(0x00000002));
}
+#if defined(CONFIG_IPV6_ISATAP)
+static inline int ipv6_isatap_eui64(u8 *eui, __be32 *addr)
+{
+ __be32 ipv4 = ntohl(*addr);
+
+ eui[0] = 0;
+
+ /* Check for RFC3330 global address ranges */
+ if (((ipv4 >= 0x01000000) && (ipv4 < 0x0a000000)) ||
+ ((ipv4 >= 0x0b000000) && (ipv4 < 0x7f000000)) ||
+ ((ipv4 >= 0x80000000) && (ipv4 < 0xa9fe0000)) ||
+ ((ipv4 >= 0xa9ff0000) && (ipv4 < 0xac100000)) ||
+ ((ipv4 >= 0xac200000) && (ipv4 < 0xc0a80000)) ||
+ ((ipv4 >= 0xc0a90000) && (ipv4 < 0xc6120000)) ||
+ ((ipv4 >= 0xc6140000) && (ipv4 < 0xe0000000))) eui[0] |=
0x2;
+
+ eui[1] = 0; eui[2] = 0x5E; eui[3] = 0xFE;
+ memcpy (eui+4, addr, 4);
+ return (0);
+}
+
+static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
+{
+ return (addr->s6_addr32[2] == __constant_htonl(0x02005EFE) ||
+ addr->s6_addr32[2] == __constant_htonl(0x00005EFE));
+}
+#endif
+
#ifdef CONFIG_PROC_FS
extern int if6_proc_init(void);
extern void if6_proc_exit(void);
-
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