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

diag: add support for SOCK_DESTROY #15

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

Conversation

anisse
Copy link
Contributor

@anisse anisse commented Oct 14, 2023

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

A long running, but buggy process might have hanging sockets kept alive by error. Using SOCK_DESTROY allows closing arbitrary sockets as root; an example tool that uses this feature and this crate is at: https://github.com/anisse/tcpkill

This PR should replace this one: little-dude/netlink#283

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

A long running, but buggy process might have hanging sockets kept alive
by error. Using SOCK_DESTROY allows closing arbitrary sockets as root;
an example tool that uses this feature and this crate is at:
https://github.com/anisse/tcpkill
@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Merging #15 (33579af) into main (30366bd) will decrease coverage by 1.15%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   40.74%   39.60%   -1.15%     
==========================================
  Files          12       11       -1     
  Lines         886      909      +23     
==========================================
- Hits          361      360       -1     
- Misses        525      549      +24     
Files Coverage Δ
src/message.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

1 participant