]> 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)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 14 Nov 2024 20:01:00 +0000 (20:01 +0000)
commit8fa4a0b5a7715ae5cfda74646d2d1b9744f964ad
tree2a3faab880e52d4dcc54dcb05c4300daf2b936b1
parent1a2504e3b5025814835c0dd4ee8a7b11b2932092
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
(cherry picked from commit 7223bddffb5bcd7e45e61cad1412854ecce94163)
include/asterisk/acl.h
main/acl.c
main/dnsmgr.c