Skip to contentSkip to conversation

iproute2: ss: add support to expose various inet sockopts

PATCH Superseded Wei Wang 2 participants 2 messages Aug 19, 2020

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

PATCH v2 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.

 include/uapi/linux/inet_diag.h | 18 ++++++++++++++
 misc/ss.c                      | 43 ++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
include/uapi/linux/inet_diag.h +18 -0
index cd83b4f8..ed1c3153 100644
@@ -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 {
misc/ss.c +43 -0

79 lines not on this page · raw message

Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
#1 lore raw
Quoted 6 lines · Wei Wang

This commit adds support to expose the following inet socket options:
-- recverr
-- is_icsk
-- freebind
-- hdrincl
-- mc_loop

Quoted 9 lines

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

[...]

Thanks for your work. It would be nice if you could update the man page for the new option.