nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.68k stars 668 forks source link

Make fields in UnknownCmsg public #2520

Closed hax0r31337 closed 1 month ago

hax0r31337 commented 1 month ago

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:

SteveLauC commented 1 month ago

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 commented 1 month ago

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

SteveLauC commented 1 month ago

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

Make sense, left a comment.