mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
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
This commit is contained in:
4
dns.c
4
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user