iproute2: ss: add support to expose various inet sockopts
Subsystems (2)
PATCH v3 1/1 iproute2: ss: add support to expose various inet sockopts
This commit adds support to expose the following inet socket options:
-- recverr
-- is_icsk
-- freebind
-- hdrincl
-- mc_loop
-- transparent
-- mc_all
-- nodefrag
-- bind_address_no_port
-- recverr_rfc4884
-- defer_connect
with the option --inet-sockopt. The individual option is only shown when set.
---v1->v2:
- Change the output to only display sockopts that are set.
v2->v3:
- Add manpage modification
include/uapi/linux/inet_diag.h | 18 ++++++++++++++ man/man8/ss.8 | 3 +++ misc/ss.c | 43 ++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+)
include/uapi/linux/inet_diag.h +18 -0
@@ -160,6 +160,7 @@ enum {INET_DIAG_ULP_INFO ,INET_DIAG_SK_BPF_STORAGES ,INET_DIAG_CGROUP_ID , +INET_DIAG_SOCKOPT , __INET_DIAG_MAX, };
@@ -183,6 +184,23 @@ struct inet_diag_meminfo {__u32 idiag_tmem; }; +/* INET_DIAG_SOCKOPT */ + +struct inet_diag_sockopt { +__u8 recverr:1 , + is_icsk:1 , + freebind:1 , + hdrincl:1 , + mc_loop:1 , + transparent:1 , + mc_all:1 , + nodefrag:1 ; +__u8 bind_address_no_port:1 , + recverr_rfc4884:1 , + defer_connect:1 , + unused:5 ; +}; +/* INET_DIAG_VEGASINFO */ struct tcpvegas_info {
man/man8/ss.8 +3 -0
@@ -379,6 +379,9 @@ Display vsock sockets (alias for -f vsock). .B \-\-xdp Display XDP sockets (alias for -f xdp). .TP +.B \-\-inet-sockopt +Display inet socket options. +.TP .B \-f FAMILY, \-\-family=FAMILY Display sockets of type FAMILY. Currently the following families are supported: unix, inet, inet6, link, netlink, vsock, xdp.
misc/ss.c +43 -0
79 lines not on this page · raw message
Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
David Ahern
AppliedQuoted 15 lines · Wei Wang
This commit adds support to expose the following inet socket options:
-- recverr
--is_icsk
-- freebind
-- hdrincl
--mc_loop
-- transparent
--mc_all
-- nodefrag
--bind_address_no_port
--recverr_rfc4884
--defer_connect
with the option --inet-sockopt. The individual option is only shown when set.
Quoted 2 lines
Signed-off-by Wei Wang <[email protected]>---
Applied to iproute2-next. Thanks,