From: Phil Sutter Date: Fri, 2 Dec 2016 10:39:46 +0000 (+0100) Subject: ss: Drop empty lines in UDP output X-Git-Tag: v4.10.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6babc649a917703571eac33347c0c39d8d0465b8;p=thirdparty%2Fiproute2.git ss: Drop empty lines in UDP output When dumping UDP sockets and show_tcpinfo (-i) is active but not show_mem (-m), print_tcpinfo() does not output anything leading to an empty line being printed after every socket. Fix this by skipping the call to print_tcpinfo() and the previous newline printing in that case. Signed-off-by: Phil Sutter --- diff --git a/misc/ss.c b/misc/ss.c index 5796d800f..18ccb6dbf 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2444,7 +2444,7 @@ static int inet_show_sock(struct nlmsghdr *nlh, } } - if (show_mem || show_tcpinfo) { + if (show_mem || (show_tcpinfo && protocol != IPPROTO_UDP)) { printf("\n\t"); if (protocol == IPPROTO_SCTP) sctp_show_info(nlh, r, tb);