nix
nix copied to clipboard
How to use `SockLevel` for `setsockopt` and IP_MULTICAST_IF
https://github.com/nix-rust/nix/blob/d922c72a765640c5e190fb01129f712e6ac513df/src/sys/socket/mod.rs#L1585
I cannot find how SockLevel is used in the code. For example, setsockopt did not have a level argument:
https://github.com/nix-rust/nix/blob/d922c72a765640c5e190fb01129f712e6ac513df/src/sys/socket/mod.rs#L1639
How can we use SockLevel? I have a use case that needs to do something like this (not real code):
setsockopt(IPPROTO_IP, IP_MULTICAST_IF, <value>);
I cannot find IP_MULTICAST_IF in Nix either. Did I miss it somewhere? Thanks.
Ooh, great question! SockLevel is actually dead code. AFAICT, its use was eliminated way back in PR #133 . So we should delete it. But what you probably ought to do is submit a PR that adds this socket option using sockopt_impl! to src/sys/socket/sockopt.rs.
thanks @asomers for opening PR #1362 to remove SockLevel. I will submit a PR to add IP_MULTICAST_IF .