summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source4/dns_server/dlz_bind9.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 677578a97e..fbb07f3bdf 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -1440,6 +1440,8 @@ static bool b9_record_match(struct dlz_bind9_data *state,
{
bool status;
int i;
+ struct in6_addr rec1_in_addr6;
+ struct in6_addr rec2_in_addr6;
if (rec1->wType != rec2->wType) {
return false;
@@ -1454,7 +1456,9 @@ static bool b9_record_match(struct dlz_bind9_data *state,
case DNS_TYPE_A:
return strcmp(rec1->data.ipv4, rec2->data.ipv4) == 0;
case DNS_TYPE_AAAA:
- return strcmp(rec1->data.ipv6, rec2->data.ipv6) == 0;
+ inet_pton(AF_INET6, rec1->data.ipv6, &rec1_in_addr6);
+ inet_pton(AF_INET6, rec2->data.ipv6, &rec2_in_addr6);
+ return memcmp(&rec1_in_addr6, &rec2_in_addr6, sizeof(rec1_in_addr6)) == 0;
case DNS_TYPE_CNAME:
return dns_name_equal(rec1->data.cname, rec2->data.cname);
case DNS_TYPE_TXT: