netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: David Miller <davem@davemloft.net>
Cc: Xin Long <lucien.xin@gmail.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	netdev@vger.kernel.org
Subject: [PATCH 3/3] sctp_diag: Respect ss adding TCPF_CLOSE to idiag_states
Date: Fri, 29 Jul 2016 18:59:40 +0200	[thread overview]
Message-ID: <1469811580-32429-4-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1469811580-32429-1-git-send-email-phil@nwl.cc>

Since 'ss' always adds TCPF_CLOSE to idiag_states flags, sctp_diag can't
rely upon TCPF_LISTEN flag solely being present when listening sockets
are requested.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 net/sctp/sctp_diag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c
index 0ad6033a7330c..92ae2828189d5 100644
--- a/net/sctp/sctp_diag.c
+++ b/net/sctp/sctp_diag.c
@@ -352,7 +352,7 @@ static int sctp_ep_dump(struct sctp_endpoint *ep, void *p)
 	if (cb->args[4] < cb->args[1])
 		goto next;
 
-	if ((r->idiag_states & ~TCPF_LISTEN) && !list_empty(&ep->asocs))
+	if (!(r->idiag_states & TCPF_LISTEN) && !list_empty(&ep->asocs))
 		goto next;
 
 	if (r->sdiag_family != AF_UNSPEC &&
@@ -467,7 +467,7 @@ skip:
 	 * 3 : to mark if we have dumped the ep info of the current asoc
 	 * 4 : to work as a temporary variable to traversal list
 	 */
-	if (!(idiag_states & ~TCPF_LISTEN))
+	if (!(idiag_states & ~(TCPF_LISTEN | TCPF_CLOSE)))
 		goto done;
 	sctp_for_each_transport(sctp_tsp_dump, net, cb->args[2], &commp);
 done:
-- 
2.8.2

      parent reply	other threads:[~2016-07-29 17:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29 16:59 [PATCH 0/3] sctp_diag: A bunch of fixes for upcoming 'ss' support Phil Sutter
2016-07-29 16:59 ` [PATCH 1/3] sctp: Export struct sctp_info to userspace Phil Sutter
2016-07-31 21:18   ` Stephen Hemminger
2016-08-01 13:36     ` Phil Sutter
2016-07-29 16:59 ` [PATCH 2/3] sctp_diag: export timer value only if it is active Phil Sutter
2016-07-29 20:51   ` Marcelo Ricardo Leitner
2016-07-30 13:25     ` Xin Long
2016-07-30 13:33       ` Marcelo Ricardo Leitner
2016-07-30 17:59         ` Phil Sutter
2016-07-31 15:57           ` Xin Long
2016-08-03 19:28       ` Phil Sutter
2016-08-03 19:46         ` Marcelo Ricardo Leitner
2016-08-03 20:15           ` Phil Sutter
2016-07-29 16:59 ` Phil Sutter [this message]

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=1469811580-32429-4-git-send-email-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.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;
as well as URLs for NNTP newsgroup(s).