Commit 1ba8d77f authored by Phil Sutter's avatar Phil Sutter Committed by David S. Miller
Browse files

sctp_diag: Respect ss adding TCPF_CLOSE to idiag_states



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: default avatarPhil Sutter <phil@nwl.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 12474e8e
...@@ -356,7 +356,7 @@ static int sctp_ep_dump(struct sctp_endpoint *ep, void *p) ...@@ -356,7 +356,7 @@ static int sctp_ep_dump(struct sctp_endpoint *ep, void *p)
if (cb->args[4] < cb->args[1]) if (cb->args[4] < cb->args[1])
goto next; goto next;
if ((r->idiag_states & ~TCPF_LISTEN) && !list_empty(&ep->asocs)) if (!(r->idiag_states & TCPF_LISTEN) && !list_empty(&ep->asocs))
goto next; goto next;
if (r->sdiag_family != AF_UNSPEC && if (r->sdiag_family != AF_UNSPEC &&
...@@ -471,7 +471,7 @@ static void sctp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, ...@@ -471,7 +471,7 @@ static void sctp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
* 3 : to mark if we have dumped the ep info of the current asoc * 3 : to mark if we have dumped the ep info of the current asoc
* 4 : to work as a temporary variable to traversal list * 4 : to work as a temporary variable to traversal list
*/ */
if (!(idiag_states & ~TCPF_LISTEN)) if (!(idiag_states & ~(TCPF_LISTEN | TCPF_CLOSE)))
goto done; goto done;
sctp_for_each_transport(sctp_tsp_dump, net, cb->args[2], &commp); sctp_for_each_transport(sctp_tsp_dump, net, cb->args[2], &commp);
done: done:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment