netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: Filter inet dgram sockets with established state by default
@ 2015-01-08 17:32 Vadim Kochan
  2015-01-14  1:31 ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Vadim Kochan @ 2015-01-08 17:32 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

As inet dgram sockets (udp, raw) can call connect(...)  - they
might be set in ESTABLISHED state. So keep the original behaviour of
'ss' which filtered them by ESTABLISHED state by default. So:

    $ ss -u

    or

    $ ss -w

Will show only ESTABLISHED UDP sockets by default.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 misc/ss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/ss.c b/misc/ss.c
index 08d210a..015d829 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -170,11 +170,11 @@ static const struct filter default_dbs[MAX_DB] = {
 		.families = (1 << AF_INET) | (1 << AF_INET6),
 	},
 	[UDP_DB] = {
-		.states   = (1 << SS_CLOSE),
+		.states   = (1 << SS_ESTABLISHED),
 		.families = (1 << AF_INET) | (1 << AF_INET6),
 	},
 	[RAW_DB] = {
-		.states   = (1 << SS_CLOSE),
+		.states   = (1 << SS_ESTABLISHED),
 		.families = (1 << AF_INET) | (1 << AF_INET6),
 	},
 	[UNIX_DG_DB] = {
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-15  4:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 17:32 [PATCH iproute2] ss: Filter inet dgram sockets with established state by default Vadim Kochan
2015-01-14  1:31 ` Stephen Hemminger
2015-01-14  6:49   ` Vadim Kochan
2015-01-14 22:41     ` Stephen Hemminger
2015-01-14 22:43       ` Vadim Kochan
2015-01-15  2:48         ` Stephen Hemminger
2015-01-15  4:49           ` Vadim Kochan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).