]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5497: Fix detection of duped IPs returned by getaddrinfo() (#2100)
authoraafbsd <45147422+aafbsd@users.noreply.github.com>
Thu, 26 Jun 2025 18:57:19 +0000 (18:57 +0000)
committerFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Fri, 27 Jun 2025 18:50:09 +0000 (19:50 +0100)
commitc3b5c7912d720c0e0e4fd2f47d4a759cd4548d04
treee9c8d7265865d0d39246d89e85874cf6598023cc
parent740a1bf5033fd765a8aabde75ae40bf14a847524
Bug 5497: Fix detection of duped IPs returned by getaddrinfo() (#2100)

    WARNING: Ignoring <IP X> because it is already covered by <IP X>

Affects `src`, `dst`, and `localip` ACLs, especially those that use
domain names with multiple DNS A or AAAA records.

IP addresses returned by getaddrinfo(3) may not be sorted (e.g., when a
host has multiple DNS A RRs on FreeBSD). Instead of comparing the
current address with just the previous one, we now check all previously
added addresses (while processing a single getaddrinfo() call output).

This surgical fix minimizes changes without improving surrounding code.
CONTRIBUTORS
src/acl/Ip.cc
src/acl/Ip.h