From: Andreas Gustafsson Date: Mon, 9 Jul 2001 22:44:12 +0000 (+0000) Subject: pullup: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb230e6d00983a87ab97b4ea65aaffabb914e5eb;p=thirdparty%2Fbind9.git pullup: 924. [port] Extend support for pre-RFC2133 IPv6 implementation. [RT #987] --- diff --git a/CHANGES b/CHANGES index 0a68e909d00..90f7da4d8a3 100644 --- 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] diff --git a/lib/isc/unix/include/isc/net.h b/lib/isc/unix/include/isc/net.h index 837db524547..1a5f2c49243 100644 --- a/lib/isc/unix/include/isc/net.h +++ b/lib/isc/unix/include/isc/net.h @@ -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 @@ -118,6 +119,29 @@ #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 /* diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index dc9b88c4234..300819664d6 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -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 @@ -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; diff --git a/lib/lwres/include/lwres/net.h b/lib/lwres/include/lwres/net.h index 44f99067761..4c1cb18fdb3 100644 --- a/lib/lwres/include/lwres/net.h +++ b/lib/lwres/include/lwres/net.h @@ -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 @@ -69,6 +69,29 @@ #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