]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix marking of problematic cached IP addresses (#1691)
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 23 Feb 2024 04:26:38 +0000 (04:26 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 23 Feb 2024 04:26:51 +0000 (04:26 +0000)
commite213ef430798d243edcd572a510acc1dd2d8346f
treec4935e3c716595368667da5986eb8fd955d70a0c
parente4bcf11723d868abd46b234d425745d5b66e5191
Fix marking of problematic cached IP addresses (#1691)

Since inception in 2017 commit fd9c47d, Dns::CachedIps::have() always
returned position zero after finding a matching IP address (at zero or
positive position). The bug affected two callers:

* markAsBad() always marked the first stored address (as bad);
* forgetMarking() always cleared the first stored address marking.

Buggy markings led to Squid sometimes not attempting to use a working
address (e.g., IPv4) while using a known problematic one (e.g., IPv6).
src/ipcache.cc