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:
James Golovich
2004-03-03 03:12:59 +00:00
parent 22b56f13cc
commit d260293f62
3 changed files with 9 additions and 3 deletions

4
srv.c
View File

@@ -79,8 +79,10 @@ static int srv_callback(void *context, u_char *answer, int len, u_char *fullansw
{
struct srv_context *c = (struct srv_context *)context;
if (parse_srv(c->host, c->hostlen, c->port, answer, len, fullanswer))
if (parse_srv(c->host, c->hostlen, c->port, answer, len, fullanswer)) {
ast_log(LOG_WARNING, "Failed to parse srv\n");
return -1;
}
if (strlen(c->host))
return 1;