Repository navigation
Conversation
asomers
left a comment
There was a problem hiding this comment.
Please enable IPV6_PKTINFO on FreeBSD, and check the other BSDs to see if any of them support it. Also, can you write a test for this? The cmsg code is devilishly difficult; it would be great to have some test coverage for every supported message type.
| &*(cmsg_data.as_ptr() as *const _))) | ||
| }, | ||
| #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios"))] | ||
| (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => unsafe { |
There was a problem hiding this comment.
FreeBSD also defines IPV6_PKTINFO. I haven't checked on any of the other BSDs.
|
Agreed about tests, it is tricky code. Will do.
Yeah the other BSDs will take longer because I only merged macOS/Linux
libc constants so far just for the sake of speed. Would you like to hold
off on this whole thing until then? Or would you accept separate PRs
after I get the rest merged in libc?
|
|
I'll wait for the libc PR. libc usually merges stuff quickly. |
|
new libc PR submitted: rust-lang/libc#983 |
|
I'm curious if this is still in progress, because I also need PKTINFO. |
| Some(ControlMessage::ScmTimestamp( | ||
| &*(cmsg_data.as_ptr() as *const _))) | ||
| }, | ||
| #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios"))] |
There was a problem hiding this comment.
These lists should be alphabetized (android, ios, linux, macos). This applies to all of your #[cfg attributes.
| ([#857](https://github.com/nix-rust/nix/pull/857)) | ||
| - Added `request_code_write_int!` on FreeBSD/DragonFlyBSD | ||
| ([#833](https://github.com/nix-rust/nix/pull/833)) | ||
| - Added PKTINFO cmsg support on Linux/macOS/iOS. |
There was a problem hiding this comment.
Change to "Added `PKTINFO` support for `cmsg` on ... platforms" (note the backticks)
|
I've updated @mcginty original changes to work with the lastest master in my ipv6_pktinfo branch. How do I contribute them to this pull request? I only see options for creating a new pull request. |
|
@pusateri sorry I've been MIA on this PR. I'm happy to close this pull request in favor of a new one you open. You have my blessing to either include my commits in that PR or squash them so it's simply under your name 🙂 |
|
Thanks @mcinty but I don't need credit. Just would like to use this feature. I can push my changes back to your branch if you give me permission. I'm just not familiar with how to update someone else's pull request. |
|
I submitted a new pull request that updates the changes, adds tests without using pre-configured loopback addresses, adds IPv6_PKTINFO for FreeBSD, and sorts the cfg options. See #990. |
990: Add cmsg PKTINFO for IPv4 and IPv6. r=asomers a=pusateri Replaces #891 and attempts to address all previous concerns. Co-authored-by: Tom Pusateri <[email protected]>
The libc changes have been merged (rust-lang/libc#980) now, so looks like it's finally time to submit a PR for this :).