netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: Fix case when UDP is printed as ipproto-xxx
@ 2015-01-08  0:42 Vadim Kochan
  2015-01-14  1:33 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Kochan @ 2015-01-08  0:42 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

When 'ss' prints UDP sockets info together with RAW sockets
e.g.:

    $ ss -a

then UDP sockets are resolved as "ipproto-xxx".

It was caused that dg_proto was set after printing UDP
socket info from netlink. So fixed issue by moving
setting dg_proto before printing info from Netlink.

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..7c94463 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2287,12 +2287,12 @@ static int udp_show(struct filter *f)
 {
 	FILE *fp = NULL;
 
+	dg_proto = UDP_PROTO;
+
 	if (!getenv("PROC_NET_UDP") && !getenv("PROC_ROOT")
 	    && inet_show_netlink(f, NULL, IPPROTO_UDP) == 0)
 		return 0;
 
-	dg_proto = UDP_PROTO;
-
 	if (f->families&(1<<AF_INET)) {
 		if ((fp = net_udp_open()) == NULL)
 			goto outerr;
-- 
2.1.3

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

end of thread, other threads:[~2015-01-14  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08  0:42 [PATCH iproute2] ss: Fix case when UDP is printed as ipproto-xxx Vadim Kochan
2015-01-14  1:33 ` Stephen Hemminger

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).