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

Make fields in UnknownCmsg public #2520

Merged
merged 6 commits into from
Oct 19, 2024
Merged

Make fields in UnknownCmsg public #2520

merged 6 commits into from
Oct 19, 2024

Conversation

hax0r31337
Copy link
Contributor

@hax0r31337 hax0r31337 commented Oct 17, 2024

What does this PR do

Made fields in nix::sys::socket::UnknownCmsg public.
This change will allow user to implement custom parsing for unsupported message, such as SOL_IP, IP_RECVORIGDSTADDR.

Checklist:

  • I have read CONTRIBUTING.md
  • A change log has been added if this PR modifies nix's API

@hax0r31337 hax0r31337 marked this pull request as ready for review October 17, 2024 16:59
@SteveLauC
Copy link
Member

Hi, thanks for the PR!

SOL_IP, IP_RECVORIGDSTADDR

You mean the socket option? If so, it has already been supported by Nix in #1772, the option type is named Ipv4OrigDstAddr, I think it is more like a BSD style naming:

And the man page only mentions the latter, shorter name.

Linux man page uses IP_RECVORIGDSTADDR.

@hax0r31337
Copy link
Contributor Author

I found out shortly after I opened this pull request.
But expose field of UnknownCmsg to the user might be useful.

src/sys/socket/mod.rs Outdated Show resolved Hide resolved
@SteveLauC
Copy link
Member

But expose field of UnknownCmsg to the user might be useful.

Make sense, left a comment.

Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@SteveLauC SteveLauC added this pull request to the merge queue Oct 19, 2024
Merged via the queue into nix-rust:master with commit c7e35cd Oct 19, 2024
39 checks passed
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