aboutsummaryrefslogtreecommitdiffstats
path: root/main/dnsmgr.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-22 16:08:13 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-22 16:08:13 +0000
commit47f923f388733952a56b262f436441cc4bbd3b9a (patch)
tree28583b72a61467cfa1a8c25e94f4549459dde85c /main/dnsmgr.c
parent55fa1516d4e8fff4017ae7420ccd1f4c0c290bc4 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@166268 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/dnsmgr.c')
-rw-r--r--main/dnsmgr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/dnsmgr.c b/main/dnsmgr.c
index c20d85d23..54d9467ee 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));