]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Mon, 9 Jul 2001 22:44:12 +0000 (22:44 +0000)
committerAndreas Gustafsson <source@isc.org>
Mon, 9 Jul 2001 22:44:12 +0000 (22:44 +0000)
 924.   [port]          Extend support for pre-RFC2133 IPv6 implementation.
                        [RT #987]

CHANGES
lib/isc/unix/include/isc/net.h
lib/isc/unix/net.c
lib/lwres/include/lwres/net.h

diff --git a/CHANGES b/CHANGES
index 0a68e909d00ba6635169d90e99e530ab7f8917d2..90f7da4d8a3397544c079ffc1e116e7e698caf74 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 
+ 924.  [port]          Extend support for pre-RFC2133 IPv6 implementation.
+                       [RT #987]
+
  919.  [bug]           rndc would segfault when rndc.conf was missing a
                        closing brace. [RT #1461]
 
index 837db5245477e86789f35af0fc86781bc13ade65..1a5f2c4924333e8e9e8f5218ab84b328294dbf9d 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: net.h,v 1.24.4.5 2001/06/26 21:55:52 tale Exp $ */
+/* $Id: net.h,v 1.24.4.6 2001/07/09 22:44:11 gson Exp $ */
 
 #ifndef ISC_NET_H
 #define ISC_NET_H 1
@@ -95,6 +95,7 @@
 #define in6_addr in_addr6      /* Required for pre RFC2133 implementations. */
 #endif
 
+#ifdef ISC_PLATFORM_HAVEIPV6
 /*
  * Required for some pre RFC2133 implementations.
  * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
 #endif
 #endif
 
+#ifndef IN6_IS_ADDR_V4MAPPED
+#define IN6_IS_ADDR_V4MAPPED(x) \
+        (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \
+         (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_V4COMPAT
+#define IN6_IS_ADDR_V4COMPAT(x) \
+        (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \
+        ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \
+         (x)->s6_addr[14] != 0 || \
+         ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1)))
+#endif
+
+#ifndef IN6_IS_ADDR_MULTICAST
+#define IN6_IS_ADDR_MULTICAST(a)        ((a)->s6_addr[0] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_LOOPBACK
+#define IN6_IS_ADDR_LOOPBACK(a)        IN6_IS_ADDR_EQUAL(a, &in6addr_loopback)
+#endif
+#endif
+
 #ifndef AF_INET6
 #define AF_INET6 99
 #endif
@@ -138,11 +162,13 @@ struct in6_pktinfo {
 #endif
 
 /*
- * Cope with a missing in6addr_any.
+ * Cope with a missing in6addr_any and in6addr_loopback.
  */
 #if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
 extern const struct in6_addr isc_net_in6addrany;
 #define in6addr_any isc_net_in6addrany
+extern const struct in6_addr isc_net_in6addrloop;
+#define in6addr_loopback isc_net_in6addrloop
 #endif
 
 /*
index dc9b88c4234ec5c9bafad1589f8c2934889bceba..300819664d65ed429cff38946b6016d911a6118c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: net.c,v 1.16.2.2 2001/01/17 17:30:50 gson Exp $ */
+/* $Id: net.c,v 1.16.2.3 2001/07/09 22:44:09 gson Exp $ */
 
 #include <config.h>
 
@@ -31,6 +31,7 @@
 
 #if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
 const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT;
+const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
 #endif
 
 static isc_once_t      once = ISC_ONCE_INIT;
index 44f9906776190902880f141e8082ac5f9c26f322..4c1cb18fdb33a2a821c492f253e86c7be5fcc3e8 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: net.h,v 1.8.4.2 2001/02/21 00:15:18 gson Exp $ */
+/* $Id: net.h,v 1.8.4.3 2001/07/09 22:44:12 gson Exp $ */
 
 #ifndef LWRES_NET_H
 #define LWRES_NET_H 1
 #define in6_addr in_addr6      /* Required for pre RFC2133 implementations. */
 #endif
 
+/*
+ * Required for some pre RFC2133 implementations.
+ * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
+ * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.  
+ * If 's6_addr' is defined then assume that there is a union and three
+ * levels otherwise assume two levels required.
+ */
+#ifndef IN6ADDR_ANY_INIT
+#ifdef s6_addr
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#else
+#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
+#endif
+#endif
+
+#ifndef IN6ADDR_LOOPBACK_INIT
+#ifdef s6_addr
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+#else
+#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
+#endif
+#endif
+
 #ifndef AF_INET6
 #define AF_INET6 99
 #endif