Clear the sockaddr_in6 structure before use#20885
Closed
vlmarek wants to merge 1 commit intocurl:masterfrom
Closed
Clear the sockaddr_in6 structure before use#20885vlmarek wants to merge 1 commit intocurl:masterfrom
vlmarek wants to merge 1 commit intocurl:masterfrom
Conversation
On Solaris this was causing intermittent issues when the private structure member __sin6_src_id had unexpectedly some value. connect(2) would then fail with EADDRNOTAVAIL.
bagder
approved these changes
Mar 11, 2026
There was a problem hiding this comment.
Pull request overview
Fixes intermittent Solaris IPv6 localhost connection failures by ensuring the sockaddr_in6 used for ::1 is fully zero-initialized before fields are set (avoiding stray values in platform-private members like __sin6_src_id).
Changes:
- Zero-initialize
struct sockaddr_in6 sa6inget_localhost6()before populating its fields.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Member
|
Thanks! |
This file contains hidden or 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
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.
On Solaris this was causing intermittent issues when the private structure member __sin6_src_id had unexpectedly some value. connect(2) would then fail with EADDRNOTAVAIL.
This patch was used on Solaris builds for last two years: https://github.com/oracle/solaris-userland/blob/master/components/curl/patches/34396154.patch
I have modified it slightly to match what the function get_localhost below does.
Thank you for curl.