naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/iproute2-3.10.0-ss-print-value-of-IPV6_V6ONLY-socket-option-if-set.patch

a4b897
From 14809558dba9fe8c9ff2943fbea8cb05f6a1bfbf Mon Sep 17 00:00:00 2001
a4b897
From: Phil Sutter <phil@nwl.cc>
a4b897
Date: Wed, 24 Jun 2015 13:07:20 +0200
a4b897
Subject: [PATCH 2/2] ss: print value of IPV6_V6ONLY socket option if set
a4b897
a4b897
If available and set, print 'v6only:1' for AF_INET6 sockets upon request
a4b897
of extended information. For IPv6 sockets bound to in6addr_any, this is
a4b897
the only way to determine if they will also accept IPv4 requests or not.
a4b897
a4b897
Signed-off-by: Phil Sutter <phil@nwl.cc>
a4b897
---
a4b897
 misc/ss.c | 5 +++++
a4b897
 1 file changed, 5 insertions(+)
a4b897
a4b897
diff --git a/misc/ss.c b/misc/ss.c
a4b897
index 954a30b..ec08e03 100644
a4b897
--- a/misc/ss.c
a4b897
+++ b/misc/ss.c
a4b897
@@ -2026,6 +2026,11 @@ static int inet_show_sock(struct nlmsghdr *nlh, struct filter *f, int protocol)
a4b897
 
a4b897
 	if (show_details) {
a4b897
 		sock_details_print(&s);
a4b897
+		if (s.local.family == AF_INET6 && tb[INET_DIAG_SKV6ONLY]) {
a4b897
+			unsigned char v6only;
a4b897
+			v6only = *(__u8 *)RTA_DATA(tb[INET_DIAG_SKV6ONLY]);
a4b897
+			printf(" v6only:%u", v6only);
a4b897
+		}
a4b897
 		if (tb[INET_DIAG_SHUTDOWN]) {
a4b897
 			unsigned char mask;
a4b897
 			mask = *(__u8 *)RTA_DATA(tb[INET_DIAG_SHUTDOWN]);
a4b897
-- 
a4b897
1.8.3.1
a4b897