Skip to content

Clear the sockaddr_in6 structure before use#20885

Closed
vlmarek wants to merge 1 commit intocurl:masterfrom
vlmarek:master
Closed

Clear the sockaddr_in6 structure before use#20885
vlmarek wants to merge 1 commit intocurl:masterfrom
vlmarek:master

Conversation

@vlmarek
Copy link
Copy Markdown
Contributor

@vlmarek vlmarek commented Mar 11, 2026

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.

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.
@github-actions github-actions bot added the name lookup DNS and related tech label Mar 11, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 sa6 in get_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.

@bagder bagder closed this in 015f1c7 Mar 11, 2026
@bagder
Copy link
Copy Markdown
Member

bagder commented Mar 11, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

3 participants