-
Notifications
You must be signed in to change notification settings - Fork 131
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
Recognize "localhost" as special and resolve to the loopback address. #4830
Merged
jellefoks
merged 8 commits into
youtube:25.lts.1+
from
jellefoks:localhost_ipv4_and_ipv6_always_fix
Feb 7, 2025
Merged
Recognize "localhost" as special and resolve to the loopback address. #4830
jellefoks
merged 8 commits into
youtube:25.lts.1+
from
jellefoks:localhost_ipv4_and_ipv6_always_fix
Feb 7, 2025
Conversation
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
3ed7159
to
5c634f6
Compare
afe4aff
to
40e3df2
Compare
Note: Only the last single commit "Recognize localhost before handing off to system" is new for this PR, the others are from #4827 that this PR depends on. |
This adds more combinations of parameters for LocalHost and SunnyDay PosixSocketResolveTest tests, including insuring that lookups work as expected with address family, socket type, and protocol hints. This will ensure that PosixSocketResolveTest will also detect systems where IPv6 localhost lookups don't work. b/369361511
Make SunnyDayFlags more forgiving, as well as the error return value for Starboard < 16 and be a little more forgiving for hint flags returned with the results.
6d6cb62
to
db4f461
Compare
db4f461
to
d4e78c3
Compare
Removed on-device label. The only remaining failures were issues not related to this PR. |
d4e78c3
to
14884a5
Compare
zhongqiliang
reviewed
Feb 6, 2025
14884a5
to
9e440b7
Compare
johnxwork
approved these changes
Feb 7, 2025
struct sockaddr_in6* address = | ||
reinterpret_cast<struct sockaddr_in6*>(musl_ai->ai_addr); | ||
address->sin6_addr = IN6ADDR_LOOPBACK_INIT; | ||
// address->sin6_addr.__in6_u.__u6_addr8[0] = 5; |
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.
Should we remove the comments here?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid using the system resolver to lookup localhost. This ensures that the application is free to use the localhost hostname and assume that both IPv4 and IPv6 adddress queries for localhost names will always resolve to the respective IP loopback address (https://datatracker.ietf.org/doc/html/rfc6761#section-6.3).
This fixes IPv6 localhost not resolving for devices where /etc/hosts is misconfigured.
b/369361511
b/377982714