Repository navigation
Fix DNS lookups for IPv6 addresses. - #8053
Conversation
andrewsavage1
left a comment
There was a problem hiding this comment.
This LGTM, but I'll ensure others get a chance to take a look. I assume we'll need to bring this into main/26.eap as well?
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request fixes an issue with DNS lookups for IPv6 addresses by correctly copying sockaddr_in6 structures in the getaddrinfo wrapper. The changes also include extensive new tests to verify DNS resolution against known IP addresses and make other tests more robust by skipping them on environments where they cannot run.
My review has identified a critical issue in the new test logic that could lead to crashes, as well as a high-severity issue where the core fix could be made more robust. I've also included a medium-severity suggestion to improve test code maintainability by reducing duplication. Please see the detailed comments below.
kaidokert
left a comment
There was a problem hiding this comment.
Great find, and looks like a good fix to me.
This comment was marked as resolved.
This comment was marked as resolved.
be39676 to
53039b5
Compare
yell0wd0g
left a comment
There was a problem hiding this comment.
This LGTM, although I'm not sure my +1 is enough for this branch.
Particularly love the added tests!
970514d to
f26a78b
Compare
Update the hashes in the test to match the new certificates.
f26a78b to
200c1c6
Compare
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 #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]>
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]>
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]>
…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]>
…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)
…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]>
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]>
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 #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