Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

RFC: diag: add support for SOCK_DESTROY #283

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

Conversation

anisse
Copy link
Contributor

@anisse anisse commented Aug 11, 2022

Please consider this PR more like a request for comments, and a feature request for SOCK_DESTROY support. I'm not really a fan of how it's implemented, but I wanted to see if this was possible, and sent the first working version :-)

It is implemented on top of SockDiagMessage, and allows using Linux's CONFIG_INET_DIAG_DESTROY feature to close an arbitrary socket.

It was previously merged by accident in PR #279 . For an example of how to use this code, see: https://github.com/anisse/tcpkill/blob/cfd96d5dec438a3722edb25938a88aa7671fae84/src/tcpkill_netlink.rs#L21

It is implemented on top of SockDiagMessage, and allows using Linux's
CONFIG_INET_DIAG_DESTROY feature to close an arbitrary socket.
@cathay4t
Copy link
Collaborator

@anisse We are moving splitting this project into small parts. Could you move this PR to https://github.com/rust-netlink/netlink-packet-sock-diag

For the comment part, personally, I would like hear the use case why privileged user/process need to shutdown a arbitrary socket. I don't like dead code.

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

Successfully merging this pull request may close these issues.

2 participants