]> git.ipfire.org Git - thirdparty/asterisk.git/commit
dnsmgr.c: dnsmgr_refresh() incorrectly flags change with DNS round-robin
authorAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Sun, 29 Sep 2024 22:45:51 +0000 (18:45 -0400)
committerAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Thu, 10 Oct 2024 15:34:26 +0000 (15:34 +0000)
commit4a3319a58798ea94d8903717583f4a78111c4e5e
treeaf82666a9e88b70eeb1270b216b89e1090a23df9
parent00d72b0e9eb5816d127d6f0afddb9afa3fda527a
dnsmgr.c: dnsmgr_refresh() incorrectly flags change with DNS round-robin

The dnsmgr_refresh() function checks to see if the IP address associated
with a name/service has changed. The gotcha is that the ast_get_ip_or_srv()
function only returns the first IP address returned by the DNS query. If
there are multiple IPs associated with the name and the returned order is
not consistent (e.g. with DNS round-robin) then the other IP addresses are
not included in the comparison and the entry is flagged as changed even
though the IP is still valid.

Updated the code to check all IP addresses and flag a change only if the
original IP is no longer valid.

Resolves: #924
include/asterisk/acl.h
main/acl.c
main/dnsmgr.c