-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS lookup should request then wait for IPv4 and IPv6 addresses #14413
DNS lookup should request then wait for IPv4 and IPv6 addresses #14413
Conversation
EWS run on previous version of this PR (hash ffd7ca9) |
ffd7ca9
to
383c541
Compare
EWS run on previous version of this PR (hash 383c541) |
void addIPAddress(IPAddress&& address) { m_addresses.append(WTFMove(address)); } | ||
void addIPAddress(IPAddress&& address) | ||
{ | ||
m_addedIPv4 |= address.isIPv4(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more m_hasReceivedIPv4
383c541
to
f4b8be8
Compare
EWS run on current version of this PR (hash f4b8be8) |
https://bugs.webkit.org/show_bug.cgi?id=257404 rdar://109911384 Reviewed by Youenn Fablet. As advised by one who knows DNS better than I do, with the code I wrote earlier today in WebKit#14326 I am missing some of the IP addresses. To receive a set of IP addresses equivalent to what CFHost received, I need to add the kDNSServiceFlagsReturnIntermediates flag. Also, there are some times when we receive IPv4 addresses then get a callback with kDNSServiceFlagsMoreComing and then sometime later receive IPv6 addresses, or vice versa. The addresses from the second set of callbacks were being dropped. To fix this, I explicitly add the protocols kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6 to request callbacks for both protocols. This makes it so that sometimes I get callbacks with kDNSServiceErr_NoSuchRecord and callbacks with IP addresses that are all zeros. We simiply ignore kDNSServiceErr_NoSuchRecord and filter out all the all-zero IP addresses. That way the result of DNSResolveQueueCFNet::performDNSLookup always contains all the IP addresses. I manually verified that IP address lists were incomplete sometimes before this change, and now they are complete all the time. There are also two unit tests that exercise this code path, webrtc/datachannel/mdns-ice-candidates.html and TestWebKitAPI.WebKit2.RTCDataChannelPostMessage and I verified that they both pass. * Source/WebCore/platform/network/DNS.cpp: (WebCore::IPAddress::isAllZeros const): * Source/WebCore/platform/network/DNS.h: * Source/WebCore/platform/network/cf/DNSResolveQueueCFNet.cpp: (WebCore::DNSResolveQueueCFNet::CompletionHandlerWrapper::complete): (WebCore::DNSResolveQueueCFNet::CompletionHandlerWrapper::addIPAddress): (WebCore::DNSResolveQueueCFNet::CompletionHandlerWrapper::shouldWaitForMoreAddresses const): (WebCore::DNSResolveQueueCFNet::CompletionHandlerWrapper::filterZeroAddresses): (WebCore::dnsLookupCallback): (WebCore::DNSResolveQueueCFNet::performDNSLookup): Canonical link: https://commits.webkit.org/264655@main
f4b8be8
to
5aa25a1
Compare
Committed 264655@main (5aa25a1): https://commits.webkit.org/264655@main Reviewed commits have been landed. Closing PR #14413 and removing active labels. |
5aa25a1
f4b8be8
π§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-gtk