diff options
author | Arvid Requate <requate@univention.de> | 2014-05-17 18:25:01 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-05-26 03:31:28 +0200 |
commit | f15d10df29285024eae75eb83e03ff14d22524e6 (patch) | |
tree | 97edc4e5dbf798d8ea94995f9b1e5cb5e0d6896a /source4 | |
parent | 13b36be68fb54d8e993aefe7b8b5e53f7316a126 (diff) | |
download | samba-f15d10df29285024eae75eb83e03ff14d22524e6.tar.gz samba-f15d10df29285024eae75eb83e03ff14d22524e6.tar.xz samba-f15d10df29285024eae75eb83e03ff14d22524e6.zip |
s4-dns: dlz_bind9: Fix ipv6 updates
b9_record_match needs to consider all allowed representations of IPv6
addresses (RFC 2373), otherwise DNS subtractrdataset operations fail
due to differences in zero padding between bind9 frontend and ndr_pull
of a dnsp_DnssrvRpcRecord structure.
Change-Id: Ic0a1b16008458993dc644646d7f4ae3d3a3c5fed
Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Reviewed-by: Guenter Kukkukk <kukks@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dns_server/dlz_bind9.c | 6 |
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: |