Netdev List
 help / color / mirror / Atom feed
From: "Petr Šabata" <contyk@redhat.com>
To: netdev@vger.kernel.org
Cc: "Petr Šabata" <contyk@redhat.com>
Subject: [PATCH] iproute2: Display closed UDP sockets on 'ss -ul'
Date: Tue, 15 Nov 2011 16:19:26 +0100	[thread overview]
Message-ID: <1321370366-18832-1-git-send-email-contyk@redhat.com> (raw)

This patch emulates 'netstat -ul' behavior, showing 'closed'
(state 07) UDP sockets when ss is called with '-ul' options.
Although dirty, this seems like the least invasive way to fix
it and shouldn't really break anything.

Signed-off-by: Petr Šabata <contyk@redhat.com>
---
 misc/ss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/misc/ss.c b/misc/ss.c
index 1353620..af774d1 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2568,7 +2568,7 @@ int main(int argc, char *argv[])
 			current_filter.states = SS_ALL;
 			break;
 		case 'l':
-			current_filter.states = (1<<SS_LISTEN);
+			current_filter.states = (1<<SS_LISTEN) | (1<<SS_CLOSE);
 			break;
 		case '4':
 			preferred_family = AF_INET;
-- 
1.7.7.1

             reply	other threads:[~2011-11-15 15:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 15:19 Petr Šabata [this message]
2011-11-17  0:25 ` [PATCH] iproute2: Display closed UDP sockets on 'ss -ul' Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321370366-18832-1-git-send-email-contyk@redhat.com \
    --to=contyk@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox