From f6f4ceece41f040cc43722afa9a5cd1f54a576b6 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Thu, 2 Dec 1999 23:45:30 +0000 Subject: [PATCH] more fully implement the 'standard' in6_addr, and use the macros correctly in adb.c --- lib/dns/adb.c | 10 +--------- lib/isc/include/isc/ipv6.h | 8 +++++++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 7d079be654..547abf74b0 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -428,12 +428,8 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset, INSIST((rdtype == dns_rdatatype_a) || (rdtype == dns_rdatatype_aaaa)); if (rdtype == dns_rdatatype_a) findoptions = DNS_ADBFIND_INET; - else { + else findoptions = DNS_ADBFIND_INET6; -#if !defined(ISC_PLATFORM_HAVEIPV6) - INSIST(0); -#endif - } addr_bucket = DNS_ADB_INVALIDBUCKET; new_addresses_added = ISC_FALSE; @@ -452,13 +448,11 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset, isc_sockaddr_fromin6(&sockaddr, &in6a, 53); } -#if defined(ISC_PLATFORM_HAVEIPV6) /* XXXMLG Should use isc_net_() function? */ if (IN6_IS_ADDR_V4MAPPED(&sockaddr.type.sin6.sin6_addr) || IN6_IS_ADDR_V4COMPAT(&sockaddr.type.sin6.sin6_addr)) { DP(1, "Ignoring IPv6 mapped IPv4 address"); goto next; } -#endif INSIST(nh == NULL); nh = new_adbnamehook(adb, NULL); @@ -563,13 +557,11 @@ import_a6(dns_a6context_t *a6ctx) isc_sockaddr_fromin6(&sockaddr, &a6ctx->in6addr, 53); -#if defined(ISC_PLATFORM_HAVEIPV6) /* XXXMLG Should use isc_net_() function? */ if (IN6_IS_ADDR_V4MAPPED(&sockaddr.type.sin6.sin6_addr) || IN6_IS_ADDR_V4COMPAT(&sockaddr.type.sin6.sin6_addr)) { DP(1, "Ignoring IPv6 mapped IPv4 address"); goto fail; } -#endif foundentry = find_entry_and_lock(adb, &sockaddr, &addr_bucket); if (foundentry == NULL) { diff --git a/lib/isc/include/isc/ipv6.h b/lib/isc/include/isc/ipv6.h index 9b8a229457..96ff34421c 100644 --- a/lib/isc/include/isc/ipv6.h +++ b/lib/isc/include/isc/ipv6.h @@ -57,11 +57,17 @@ ISC_LANG_BEGINDECLS struct in6_addr { union { isc_uint8_t _S6_u8[16]; + isc_uint16_t _S6_u16[8]; isc_uint32_t _S6_u32[4]; +#if 0 /* Is this really part of the standard? */ isc_uint64_t _S6_u64[2]; +#endif } _S6_un; }; -#define s6_addr _S6_un._S6_u8 +#define s6_addr _S6_un._S6_u8 +#define s6_addr8 _S6_un._S6_u8 +#define s6_addr16 _S6_un._S6_u16 +#define s6_addr32 _S6_un._S6_u32 #define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}} #define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}}