summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-11-21 23:37:03 +0100
committerMatthieu Patou <mat@matws.net>2011-12-05 18:23:08 +0100
commit059523e2036d8a2215fd4ea59047e2d9dacce062 (patch)
treed7f92e1c107f3543163b256022013e94c80a4670 /source4/libcli/resolve
parent2f8a84bb7b430c68c06f4121df6905b163f7ae71 (diff)
downloadsamba-059523e2036d8a2215fd4ea59047e2d9dacce062.tar.gz
samba-059523e2036d8a2215fd4ea59047e2d9dacce062.tar.bz2
samba-059523e2036d8a2215fd4ea59047e2d9dacce062.zip
s4-resolver: do not use all the A and AAAA records, those after a NS are not the one we want to use
Diffstat (limited to 'source4/libcli/resolve')
-rw-r--r--source4/libcli/resolve/dns_ex.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 20f2c0c03a..9467521394 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -89,6 +89,14 @@ static uint32_t count_dns_rr(struct rk_resource_record *head, unsigned record_ty
continue;
}
+ if (rr->type == rk_ns_t_ns) {
+ /*
+ * Record that will follow will be related to the NS
+ * not what we are really interested with.
+ * It's a good idea not to count them
+ */
+ break;
+ }
/* we are only interested by requested record */
if (rr->type != record_type) {
continue;
@@ -234,6 +242,14 @@ static struct dns_records_container get_a_aaaa_records(TALLOC_CTX *mem_ctx,
continue;
}
+ if (rr->type == rk_ns_t_ns) {
+ /*
+ * After the record for NS will come the A or AAAA
+ * record of the NS.
+ */
+ break;
+ }
+
/* we are only interested in A and AAAA records */
if (rr->type != rk_ns_t_a && rr->type != rk_ns_t_aaaa) {
continue;