summaryrefslogtreecommitdiff
path: root/main/dns.c
diff options
context:
space:
mode:
authorBrett Bryant <bbryant@digium.com>2008-07-08 21:00:01 +0000
committerBrett Bryant <bbryant@digium.com>2008-07-08 21:00:01 +0000
commit52e8897977ee49edfcce5b47cba2e11144a42086 (patch)
tree8e9a693e7fa17da065334a16d148af63f7faaf5b /main/dns.c
parentda03cdd174465af1429358bef0a72c365932b3ee (diff)
Fix a bug in SRV lookups where dnsmgr would discard everything but the
first SRV result from DNS before processing weights and priorities and dns_parse_answer wouldn't report that there were no records in DNS unless a failure occured. Also fixed a bug where dnsmgr_refresh would report that a entry was being changed when ast_gethostbyname had failed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/dns.c')
-rw-r--r--main/dns.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/dns.c b/main/dns.c
index 4884406cb..ad1673830 100644
--- a/main/dns.c
+++ b/main/dns.c
@@ -189,6 +189,7 @@ static int dns_parse_answer(void *context,
unsigned char *fullanswer = answer;
struct dn_answer *ans;
dns_HEADER *h;
+ int ret = 0;
int res;
int x;
@@ -234,14 +235,13 @@ static int dns_parse_answer(void *context,
ast_log(LOG_WARNING, "Failed to parse result\n");
return -1;
}
- if (res > 0)
- return 1;
+ ret = 1;
}
}
answer += ntohs(ans->size);
len -= ntohs(ans->size);
}
- return 0;
+ return ret;
}
#ifndef HAVE_RES_NINIT