From 52e8897977ee49edfcce5b47cba2e11144a42086 Mon Sep 17 00:00:00 2001 From: Brett Bryant Date: Tue, 8 Jul 2008 21:00:01 +0000 Subject: 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 --- main/dnsmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'main/dnsmgr.c') diff --git a/main/dnsmgr.c b/main/dnsmgr.c index cae20f4b7..727d8b5fc 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -164,8 +164,7 @@ static int dnsmgr_refresh(struct ast_dnsmgr_entry *entry, int verbose) if (verbose) ast_verb(3, "refreshing '%s'\n", entry->name); - ast_get_ip_or_srv(&tmp, entry->name, entry->service); - if (inaddrcmp(&tmp, &entry->last)) { + if (!ast_get_ip_or_srv(&tmp, entry->name, entry->service) && inaddrcmp(&tmp, &entry->last)) { ast_copy_string(iabuf, ast_inet_ntoa(entry->last.sin_addr), sizeof(iabuf)); ast_copy_string(iabuf2, ast_inet_ntoa(tmp.sin_addr), sizeof(iabuf2)); ast_log(LOG_NOTICE, "dnssrv: host '%s' changed from %s:%d to %s:%d\n", -- cgit v1.2.3