mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
more fully implement the 'standard' in6_addr, and use the macros correctly
in adb.c
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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 }}}
|
||||
|
Reference in New Issue
Block a user