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

datalink(linux): add feature to pass the fd (socket) to ::channel() #584

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Martichou
Copy link
Contributor

This can be useful if the caller want to manipulate the socket differently at creating.
For example setting a BPF filter on the socket before passing it in the channel:

datalink::linux::channel(interface, config, socket_fd)

Signed-off-by: Martin Andre martin.andre@tessares.net

pnet_datalink/src/lib.rs Outdated Show resolved Hide resolved
pnet_datalink/src/linux.rs Outdated Show resolved Hide resolved
This can be useful if the caller want to manipulate the
socket differently at creating. For example setting a
BPF filter on the socket before passing it in the channel:

```
datalink::linux::channel(interface, config, socket_fd)
```

Signed-off-by: Martin Andre <martin.andre@tessares.net>
@Martichou
Copy link
Contributor Author

Hey @mrmonday , sorry for the very very late reply and update on this. Just came back to this and still think this can be helpful to have in the lib.

The tests failing seems to not be linked with the change, can they be ignored? Or any idea?

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

Successfully merging this pull request may close these issues.

None yet

2 participants