From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] Fix ss Netid column and Local/Peer_Address Date: Mon, 29 Oct 2018 10:02:04 -0700 Message-ID: <20181029100204.591cf716@xeon-e3> References: <5185850.l7bAsbzJZX@yo-gs> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: "Yoann P." Return-path: Received: from mail-pl1-f196.google.com ([209.85.214.196]:45448 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbeJ3Bvk (ORCPT ); Mon, 29 Oct 2018 21:51:40 -0400 Received: by mail-pl1-f196.google.com with SMTP id o19-v6so4095044pll.12 for ; Mon, 29 Oct 2018 10:02:12 -0700 (PDT) In-Reply-To: <5185850.l7bAsbzJZX@yo-gs> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 26 Oct 2018 22:53:32 +0200 "Yoann P." wrote: > When using ss -Hutn4 or -utn3, Netid and State columns are sometime merged, it > can be confusing when trying to pipe into awk or column. > Details (before and after output) are available on this github issue: https:// > github.com/shemminger/iproute2/issues/20 > > Signed-off-by: YoyPa > --- > misc/ss.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/misc/ss.c b/misc/ss.c > index c8970438..5e46cc0e 100644 > --- a/misc/ss.c > +++ b/misc/ss.c > @@ -144,9 +144,9 @@ static struct column columns[] = { > { ALIGN_LEFT, "State", " ", 0, 0, 0 }, > { ALIGN_LEFT, "Recv-Q", " ", 0, 0, 0 }, > { ALIGN_LEFT, "Send-Q", " ", 0, 0, 0 }, > - { ALIGN_RIGHT, "Local Address:", " ", 0, 0, 0 }, > + { ALIGN_RIGHT, "Local_Address:", " ", 0, 0, 0 }, > { ALIGN_LEFT, "Port", "", 0, 0, 0 }, > - { ALIGN_RIGHT, "Peer Address:", " ", 0, 0, 0 }, > + { ALIGN_RIGHT, "Peer_Address:", " ", 0, 0, 0 }, > { ALIGN_LEFT, "Port", "", 0, 0, 0 }, > { ALIGN_LEFT, "", "", 0, 0, 0 }, > }; > @@ -1334,7 +1334,7 @@ static void sock_state_print(struct sockstat *s) > out("`- %s", sctp_sstate_name[s->state]); > } else { > field_set(COL_NETID); > - out("%s", sock_name); > + out("%-6s", sock_name); > field_set(COL_STATE); > out("%s", sstate_name[s->state]); > } Thank for your patch, it does address a bug. But iproute2 uses kernel coding style and your patch uses spaces instead of tabs. WARNING: please, no spaces at the start of a line #35: FILE: misc/ss.c:147: + { ALIGN_RIGHT, "Local_Address:", " ", 0, 0, 0 },$ WARNING: please, no spaces at the start of a line #38: FILE: misc/ss.c:149: + { ALIGN_RIGHT, "Peer_Address:", " ", 0, 0, 0 },$ ERROR: code indent should use tabs where possible #47: FILE: misc/ss.c:1337: + out("%-6s", sock_name);$ WARNING: please, no spaces at the start of a line #47: FILE: misc/ss.c:1337: + out("%-6s", sock_name);$