Skip to content

starboard: Cherry pick PR #8053: Fix DNS lookups for IPv6 addresses. - #8367

Merged
jellefoks merged 1 commit into
youtube:mainfrom
jellefoks:dns6_lookup_fix_main
Dec 16, 2025
Merged

jellefoks merged 1 commit into
youtube:mainfrom
jellefoks:dns6_lookup_fix_main

Conversation

@jellefoks

Copy link
Copy Markdown
Member

Refer to the original PR: #8053

The Starboard layer wrapper for getaddrinfo() made incorrect copies of
the sockaddr structure for IPv6 addresses. This issue prevented proper
resolution and use of IPv6 addresses for DNS lookups.

This change modifies the wrapper to ensure that the entire sockaddr
structure, including the address data, is correctly copied, thus
resolving the IPv6 address lookup failures. Additionally, extensive
tests have been added and updated to thoroughly verify both IPv4 and
IPv6 address resolution for known external hosts and localhost.

Bug: 460175900
Bug: 438858995
Bug: 409716671
Bug: 460594994
Bug: 439002238
Bug: 405988446

@jellefoks
jellefoks requested review from a team as code owners December 11, 2025 15:51
@github-actions

This comment was marked as resolved.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a cherry-pick of an upstream change to fix DNS lookups for IPv6 addresses. The core fix in starboard/shared/modular/starboard_layer_posix_socket_abi_wrappers.cc correctly addresses an issue with copying sockaddr structures for IPv6 by ensuring the entire structure is copied. This is accompanied by robust test enhancements in starboard/nplb/posix_compliance/posix_socket_resolve_test.cc to validate the fix for both IPv4 and IPv6. The pull request also includes a significant refactoring, moving responsibilities from cobalt/browser to cobalt/shell and improving Android connectivity detection logic. In accordance with the repository's style guide for cherry-picks, this review focused on the correct application of the patch. The changes are extensive but appear to be self-consistent and correctly integrated.

@jellefoks
jellefoks changed the base branch from dns6_lookup_fix_main to main December 11, 2025 15:57
The Starboard layer wrapper for getaddrinfo() made incorrect copies of
the address returned for IPv6 addresses.

This fixes that and adds extensive testing using a host with known IP
addresses.

The fix is adopted from youtube#7588 with
a simplification and additional tests.

This PR also includes an update to test certs for net_unittests that
expired Oct 29 2025.

Bug: 460175900
Bug: 438858995
Bug: 409716671
Bug: 460594994
Bug: 439002238
Bug: 405988446

---------

Co-authored-by: jimmy.ge <[email protected]>

@yell0wd0g yell0wd0g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops didn't see my +1 was needed. Doing it now

@jellefoks
jellefoks merged commit 2280057 into youtube:main Dec 16, 2025
396 checks passed
@jellefoks jellefoks added the cp-26.eap Cherry Pick to the 26.eap branch label Dec 16, 2025
cobalt-github-releaser-bot pushed a commit that referenced this pull request Dec 16, 2025
…8367)

Refer to the original PR: #8053

The Starboard layer wrapper for getaddrinfo() made incorrect copies of
the sockaddr structure for IPv6 addresses. This issue prevented proper
resolution and use of IPv6 addresses for DNS lookups.

This change modifies the wrapper to ensure that the entire sockaddr
structure, including the address data, is correctly copied, thus
resolving the IPv6 address lookup failures. Additionally, extensive
tests have been added and updated to thoroughly verify both IPv4 and
IPv6 address resolution for known external hosts and localhost.

Bug: 460175900
Bug: 438858995
Bug: 409716671
Bug: 460594994
Bug: 439002238
Bug: 405988446

Co-authored-by: jimmy.ge <[email protected]>
(cherry picked from commit 2280057)
jellefoks added a commit that referenced this pull request Dec 16, 2025
…s for IPv6 addresses. (#8428)

Refer to the original PR: #8367

Refer to the original PR: #8053

The Starboard layer wrapper for getaddrinfo() made incorrect copies of
the sockaddr structure for IPv6 addresses. This issue prevented proper
resolution and use of IPv6 addresses for DNS lookups.

This change modifies the wrapper to ensure that the entire sockaddr
structure, including the address data, is correctly copied, thus
resolving the IPv6 address lookup failures. Additionally, extensive
tests have been added and updated to thoroughly verify both IPv4 and
IPv6 address resolution for known external hosts and localhost.

Bug: 460175900
Bug: 438858995
Bug: 409716671
Bug: 460594994
Bug: 439002238
Bug: 405988446

Co-authored-by: Jelle Foks <[email protected]>
Co-authored-by: jimmy.ge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp-26.eap Cherry Pick to the 26.eap branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants