]> git.proxmox.com Git - mirror_iproute2.git/commit - misc/ss.c
ss: support closing inet sockets via SOCK_DESTROY.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 8 Jan 2016 08:32:37 +0000 (17:32 +0900)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 18 Jan 2016 19:47:03 +0000 (11:47 -0800)
commitfb2594c183fbedbe8f91fe7b1f7fed1331bb3194
tree1b2cd225e432267cee38eff2b87fe7b01abd4d23
parent57fdf2d4d94aeee493214d455b8f3336f09afa09
ss: support closing inet sockets via SOCK_DESTROY.

This patch adds a -K / --kill option to ss that attempts to
forcibly close matching sockets using SOCK_DESTROY.

Because ss typically prints sockets instead of acting on them,
and because the kernel only supports forcibly closing some types
of sockets, the output of -K is as follows:

- If closing the socket succeeds, the socket is printed.
- If the kernel does not support forcibly closing this type of
  socket (e.g., if it's a UDP socket, or a TIME_WAIT socket),
  the socket is silently skipped.
- If an error occurs (e.g., permission denied), the error is
  reported and ss exits.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
man/man8/ss.8
misc/ss.c