forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dns/apple: Ensure the Apple DNS resolver gets all IPs for the host
If the DNS query protocol to the Apple DNS resolution API `DNSServiceGetAddrInfo` is either IPv4 | IPv6, or if protocol is set to 0, the resolution callback will be invoked at least twice: at least once for the IPv4 family and at least once for the IPv6 family. Previously, we were not waiting to ensure we received both the IPv4 and the IPv6 response (even if empty), which meant the resolver would finish a DNS resolution without necessarily getting all the responses from the `DNSServiceGetAddrInfo` call. If the resolver finished while getting an IPv6 address, but not yet having received an IPv4 address for the host, and the device is on a network that doesn't support IPv6, then connections made to the host would all result in a "no route to host" error. This PR fixes the problem by ensuring we don't finish the DNS query resolution until all responses (for both v4 and v6, if requested) have been received in the resolution response callback. Signed-off-by: Ali Beyad <abeyad@google.com>
- Loading branch information
Showing
3 changed files
with
256 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.