Skip to content

Instantly share code, notes, and snippets.

Created September 9, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a3e855fd8865334ded5322517c9a9dcd to your computer and use it in GitHub Desktop.
Save anonymous/a3e855fd8865334ded5322517c9a9dcd to your computer and use it in GitHub Desktop.
From a620662fbb3891f705afcb1f13240197bc0457af Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Thu, 8 Sep 2016 14:57:03 +0300
Subject: [PATCH] ss: Add inet raw sockets information gathering via netlink
diag interface
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
misc/ss.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/misc/ss.c b/misc/ss.c
index 3b268d9..66251d7 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2631,6 +2631,10 @@ static int raw_show(struct filter *f)
dg_proto = RAW_PROTO;
+ if (!getenv("PROC_NET_RAW") && !getenv("PROC_ROOT") &&
+ inet_show_netlink(f, NULL, IPPROTO_RAW) == 0)
+ return 0;
+
if (f->families&(1<<AF_INET)) {
if ((fp = net_raw_open()) == NULL)
goto outerr;
--
2.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment