From: Vadim Kochan Date: Thu, 8 Jan 2015 00:42:54 +0000 (+0200) Subject: ss: Fix case when UDP is printed as ipproto-xxx X-Git-Tag: v3.19.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace5cb31b1f0f8f4e5644808234f9843409e86a6;p=thirdparty%2Fiproute2.git ss: Fix case when UDP is printed as ipproto-xxx 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 --- diff --git a/misc/ss.c b/misc/ss.c index 08d210ae8..7c9446393 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<