]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
more fully implement the 'standard' in6_addr, and use the macros correctly
authorMichael Graff <mgraff@isc.org>
Thu, 2 Dec 1999 23:45:30 +0000 (23:45 +0000)
committerMichael Graff <mgraff@isc.org>
Thu, 2 Dec 1999 23:45:30 +0000 (23:45 +0000)
in adb.c

lib/dns/adb.c
lib/isc/include/isc/ipv6.h

index 7d079be6541654dd5b4e541e1222d2ab07f49e5e..547abf74b02a8ef17e17e39d30af3c46a89527d3 100644 (file)
@@ -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) {
index 9b8a229457980af1746cfa04f4477c0a70822527..96ff34421c42d3c0e8746e6ade1a74688d6cc8f5 100644 (file)
@@ -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 }}}