nix
nix copied to clipboard
Support for socket options to get/set TOS/TTL info
Add support for getting/setting IPv4 type-of-service (TOS) and time-to-live (TTL) information, and IPv6 traffic class (TC) and hop count information.
Depends on https://github.com/rust-lang/libc/pull/3450, which was recently merged.
(This is my first PR to nix, and I'm also reasonably new to Rust. Please let me know if I missed anything I should have changed; am happy to rework this.)
Hi! Thanks for your interest in contributing to Nix! :)
A libc with that patch hasn't been released yet, so we have to wait.
And a CHANGELOG entry is needed, please see CONTRIBUTING.md on how to add one.
@SteveLauC Thanks! I will convert this to a draft PR until libc has been released. Will also update CHANGELOG.
Hi @larseggert, we now use the libc dependency from git, so you don't need to patch it yourself, rebasing your branch should make things work
@asomers I added a test. Note that there is a FIXME in there - cmsg_space! returns too little space when called with the option types. I can't figure out why that is.
@SteveLauC I added a CHANGELOG entry.
Hi, sorry for the late response, I think I will take another look at this PR tomorrow:)