aboutsummaryrefslogtreecommitdiffstats
path: root/dns.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-03 03:12:59 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-03 03:12:59 +0000
commit0a96ddcf480c98b32ce03b03fcdeef0c4f467e6d (patch)
tree8f577d0cdf725a2005a717e8946d82be97606aab /dns.c
parent15053dac45e009b1474e6619333ae1039ee0afcf (diff)
Make DNS callbacks return -1 on error, so invalid records are ignored
(bug #1137) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2311 f38db490-d61c-443f-a65b-d21fe96a405b
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;
}