]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 23 Feb 2024 16:40:13 +0000 (05:40 +1300)
commitaef157a3f6f3fba84b90956a15e91e15e14743eb
treedb506169d6b6d5f346a66c6d2575b78e7ea05267
parent42403ecff90b770a7d13ff0a5cbf2a94534e069e
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