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

@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 38.31%. Comparing base (f5f4ad7) to head (6b9660d).

Files with missing lines Patch % Lines
src/message.rs 0.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   39.34%   38.31%   -1.04%     
==========================================
  Files          11       11              
  Lines         854      877      +23     
==========================================
  Hits          336      336              
- Misses        518      541      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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
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