Fix IPV6_PKTINFO/IP_PKTINFO sockopts: use in6_pktinfo/in_pktinfo #2687
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.
What does this PR do
Summary
This PR fixes the Ipv6PacketInfo and Ipv4PacketInfo sockopts to use the proper payload types (libc::in6_pktinfo and libc::in_pktinfo) instead of bool. It also updates the docs to state that these options relate to outgoing packets (not “incoming”).
Rationale
What changes
Compatibility
This is an API breaking change for the affected sockopts (Val = bool → struct). However, the previous signature was incorrect per the standards and typical OS behavior. Code that intended to enable receiving pktinfo should have been using Ipv6RecvPacketInfo (boolean). Code that wants to select the source address / outgoing interface should pass an in6_pktinfo.
Checklist:
CONTRIBUTING.md