lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 26 Oct 2018 22:53:32 +0200
From:   "Yoann P." <yoann.p.public@...il.com>
To:     netdev@...r.kernel.org
Cc:     yoann.p.public@...il.com
Subject: [PATCH] Fix ss Netid column and Local/Peer_Address

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 <yoann.p.public@...il.com>
---
 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]);
        }
-- 
2.19.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ