summaryrefslogtreecommitdiff
path: root/dns.c
diff options
context:
space:
mode:
authorJames Golovich <james@gnuinter.net>2004-03-03 03:12:59 +0000
committerJames Golovich <james@gnuinter.net>2004-03-03 03:12:59 +0000
commitd260293f623312bfde1dc63b9052276a5cc82c59 (patch)
tree8f577d0cdf725a2005a717e8946d82be97606aab /dns.c
parent22b56f13cc154d8f5dbaff1362c263489cd2beb8 (diff)
Make DNS callbacks return -1 on error, so invalid records are ignored
(bug #1137) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'dns.c')
-rwxr-xr-xdns.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dns.c b/dns.c
index 7f8615424..3c89c3c8b 100755
--- a/dns.c
+++ b/dns.c
@@ -137,8 +137,10 @@ static int dns_parse_answer(void *context,
if (ntohs(ans->class) == class && ntohs(ans->rtype) == type) {
if (callback) {
- if ((res = callback(context, answer, ntohs(ans->size), fullanswer)) < 0)
+ if ((res = callback(context, answer, ntohs(ans->size), fullanswer)) < 0) {
ast_log(LOG_WARNING, "Failed to parse result\n");
+ return -1;
+ }
if (res > 0)
return 1;
}