From f32d43763d35fe386bfa1e9f7997b7eb1014b20c Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 15 May 2012 16:28:44 +0300 Subject: dns: fix comments and make s4/libcli/resolve dns resolver working After migrating to use libaddns, reply_to_addrs() needed to change the way answers are iterated through. Originally libroken implementation gave all answers as separate records with last one being explicitly NULL. libaddns unmarshalling code gives all non-NULL answers and should be iterated with explicit reply->num_answers in use. --- source4/libcli/resolve/dns_ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli') diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c index 3b303d261f..7f5b84191a 100644 --- a/source4/libcli/resolve/dns_ex.c +++ b/source4/libcli/resolve/dns_ex.c @@ -98,7 +98,7 @@ static int reply_to_addrs(TALLOC_CTX *mem_ctx, uint32_t *a_num, } *cur_addrs = addrs; - for (i = 0; reply->answers[i]; i++) { + for (i = 0; i < reply->num_answers; i++) { rr = reply->answers[i]; /* we are only interested in the IN class */ -- cgit