nix icon indicating copy to clipboard operation
nix copied to clipboard

Support for socket options to get/set TOS/TTL info

Open larseggert opened this issue 1 year ago • 5 comments
trafficstars

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.)

larseggert avatar Nov 23 '23 06:11 larseggert

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 avatar Nov 23 '23 06:11 SteveLauC

@SteveLauC Thanks! I will convert this to a draft PR until libc has been released. Will also update CHANGELOG.

larseggert avatar Nov 23 '23 07:11 larseggert

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

SteveLauC avatar Dec 04 '23 03:12 SteveLauC

@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.

larseggert avatar Dec 08 '23 11:12 larseggert

Hi, sorry for the late response, I think I will take another look at this PR tomorrow:)

SteveLauC avatar Jan 07 '24 07:01 SteveLauC