]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ss: Add support for dumping TCP bound-inactive sockets.
authorGuillaume Nault <gnault@redhat.com>
Tue, 19 Dec 2023 13:18:13 +0000 (14:18 +0100)
committerDavid Ahern <dsahern@kernel.org>
Wed, 20 Dec 2023 16:15:49 +0000 (16:15 +0000)
commitae447da64975ad02e40a93ccbc440a6477af96c0
tree08d685089ba3901bde41fe9597620fa2b10b0db8
parentb6df01d17752d746cdca6383db21d34279f0d1f4
ss: Add support for dumping TCP bound-inactive sockets.

Make ss aware of the new "bound-inactive" pseudo-state for TCP (see
Linux commit 91051f003948 ("tcp: Dump bound-only sockets in inet_diag.")).
These are TCP sockets that have been bound, but are neither listening nor
connecting.

With this patch, these sockets can now be dumped with:

  * the existing -a (--all) option, to dump all sockets, including
    bound-inactive ones,

  * the new -B (--bound-inactive) option, to dump them exclusively,

  * the new "bound-inactive" state, to be used in a STATE-FILTER.

Note that the SS_BOUND_INACTIVE state is a pseudo-state used for queries
only. The kernel returns them as SS_CLOSE.

The SS_NEW_SYN_RECV pseudo-state is added in this patch only because we
have to set its entry in the sstate_namel array (in scan_state()). Care
is taken not to make it visible by users.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
man/man8/ss.8
misc/ss.c