]> git.proxmox.com Git - mirror_iproute2.git/commit - misc/ss.c
ss: Fix for added diag support check
authorPhil Sutter <phil@nwl.cc>
Mon, 28 Aug 2017 17:31:22 +0000 (19:31 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 30 Aug 2017 15:18:13 +0000 (08:18 -0700)
commit6c6bbc30f4e7fedc74381627f7ec86d26050b404
tree8a7b24fec76045c7cb657191d8e978c985b767e9
parentc4fc474b889aa17ada813018aae6b20030e9c58e
ss: Fix for added diag support check

Commit 9f66764e308e9 ("libnetlink: Add test for error code returned from
netlink reply") changed rtnl_dump_filter_l() to return an error in case
NLMSG_DONE would contain one, even if it was ENOENT.

This in turn breaks ss when it tries to dump DCCP sockets on a system
without support for it: The function tcp_show(), which is shared between
TCP and DCCP, will start parsing /proc since inet_show_netlink() returns
an error - yet it parses /proc/net/tcp which doesn't make sense for DCCP
sockets at all.

On my system, a call to 'ss' without further arguments prints the list
of connected TCP sockets twice.

Fix this by introducing a dedicated function dccp_show() which does not
have a fallback to /proc, just like sctp_show(). And since tcp_show()
is no longer "multi-purpose", drop it's socktype parameter.

Fixes: 9f66764e308e9 ("libnetlink: Add test for error code returned from netlink reply")
Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c