Skip to content
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

Add connect_unspec #895

Closed
wants to merge 1 commit into from
Closed

Conversation

badeend
Copy link
Contributor

@badeend badeend commented Oct 25, 2023

Main use case: to change a UDP socket's association.

@badeend badeend force-pushed the connect_unspec branch 3 times, most recently from b313ab2 to 2f170c4 Compare October 25, 2023 13:52

/// Even though an AF_UNSPEC socket address contains only the family, they're
/// still required to be at least as big as the socket's regular address structure.
/// We (ab)use `sockaddr_in6` to push the size up to satisfy both IPv4 and IPv6 sockets.
Copy link
Member

Choose a reason for hiding this comment

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

Could you say more about what requires the encoded socket to be as big as the socket's regular address structure? If the socket is not IPv4 or IPv6, what would happen here? Would it make sense to use c::sockaddr_storage here instead?

@badeend
Copy link
Contributor Author

badeend commented Oct 26, 2023

Replaced by #902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants