From: Joshua Colp Date: Mon, 22 Dec 2008 16:08:13 +0000 (+0000) Subject: Record the previous port in the temporary address structure so that the comparison... X-Git-Tag: 1.6.2.0-beta1~532 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29b658f040e243e1cab9e07a0ca07a0505fe1257;p=thirdparty%2Fasterisk.git Record the previous port in the temporary address structure so that the comparison does not treat the host as having changed even if it did not. This would have been uninitialized before and would have led to a baddddd port. (closes issue #13628) Reported by: pananix Patches: bug13628.patch uploaded by jpeeler (license 325) Tested by: file, blitzrage git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166268 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/dnsmgr.c b/main/dnsmgr.c index c20d85d233..54d9467eec 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -164,6 +164,8 @@ static int dnsmgr_refresh(struct ast_dnsmgr_entry *entry, int verbose) if (verbose) ast_verb(3, "refreshing '%s'\n", entry->name); + tmp.sin_port = entry->last.sin_port; + 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));