[squid-dev] [PATCH] Happy Eyeballs: Deliver DNS results to peer selection ASAP
Alex Rousskov
rousskov at measurement-factory.com
Fri Jun 30 22:44:57 UTC 2017
Hello,
This patch completes a series of Happy Eyeballs-related changes:
1. stable Squid: Parallel DNS A and AAAA queries.
2. v5 r15183: ASAP delivery of IPs from peer selection to FwdState.
3. This patch: ASAP delivery of IPs from DNS to peer selection.
4. A separate project should add: Parallel TCP connections.
Patched Squid uses the first discovered IP address (e.g., IPv6 from a
DNS AAAA query) without waiting for the other IP address (e.g., IPv4
from a still-pending DNS A query).
Please see the patch preamble for the (many) technical details.
Besides posting this patch for a thorough review, I have one specific
question to ask: May I remove caching of "unusable" /etc/hosts IPs?
When IPv6 is disabled, the official Squid code does not allow IPv6
addresses in DNS records to enter the IP cache. However, there are no
such protections when loading IPs from /etc/hosts (see
ipcacheAddEntryFromHosts). The patch has to do quite a bit of extra work
to preserve that functionality (to see a few examples, search the patch
for "alwaysBad").
The current approach (preserved by the patch) feels inconsistent. When
IPv6 support is disabled, if we still want to cache IPv6 addresses for
ACL matching, host validation, or other purposes, then we should allow
IPv6 addresses in DNS answers to be cached as well or even submit AAAA
queries to actively seek those valuable addresses! On the other hand, if
we do not want IPv6 addresses when IPv6 is disabled, then we should not
cache IPv6 /etc/hosts entries.
If caching IPv6 /etc/hosts entries when IPv6 support is disabled was an
accident, then I will remove that functionality, simplifying the patch.
If it was intentional, then I will leave the patch as is.
The patch contains a "stop caching alwaysBad() IPs" XXX for the
/etc/hosts question above. All other added XXXs and TODOs are outside
this project scope.
Thank you,
Alex.
P.S. If the patch is accepted, I will reformat it. I think I need to
upgrade my setup to get the newer astyle version that v5 is using now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID69-deliver-ip-asap-t7.patch
Type: text/x-patch
Size: 112758 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170630/02a7832d/attachment-0001.bin>
More information about the squid-dev
mailing list