Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use SockLevel for setsockopt and IP_MULTICAST_IF #1360

Open
keepsimple1 opened this issue Dec 15, 2020 · 2 comments
Open

How to use SockLevel for setsockopt and IP_MULTICAST_IF #1360

keepsimple1 opened this issue Dec 15, 2020 · 2 comments

Comments

@keepsimple1
Copy link

pub enum SockLevel {

I cannot find how SockLevel is used in the code. For example, setsockopt did not have a level argument:

pub fn setsockopt<O: SetSockOpt>(fd: RawFd, opt: O, val: &O::Val) -> Result<()> {

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.

@asomers
Copy link
Member

asomers commented Dec 15, 2020

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.

@keepsimple1
Copy link
Author

thanks @asomers for opening PR #1362 to remove SockLevel. I will submit a PR to add IP_MULTICAST_IF .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants