Fix the format when the output for a socket spans multiple lines.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Sure. Here is the output without the fix:
tuexen@head:~/freebsd-src/usr.bin/sockstat % sockstat -Ptcp,sctp USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS tuexen nc 1671 3 sctp4 127.0.0.1:10061 127.0.0.1:1234 ?? ?? ?? ?? 192.168.1.71:10061 ?? tuexen nc 1670 3 sctp4 127.0.0.1:1234 *:* tuexen nc 1670 4 sctp4 127.0.0.1:1234 127.0.0.1:10061 ?? ?? ?? ?? ?? 192.168.1.71:10061 tuexen sshd-sessi 1661 7 tcp4 192.168.1.71:22 192.168.1.195:56451 root sshd-sessi 1659 7 tcp4 192.168.1.71:22 192.168.1.195:56451 tuexen sshd-sessi 1654 7 tcp4 192.168.1.71:22 192.168.1.195:56448 root sshd-sessi 1652 7 tcp4 192.168.1.71:22 192.168.1.195:56448 tuexen sshd-sessi 1647 7 tcp4 192.168.1.71:22 192.168.1.195:56445 root sshd-sessi 1645 7 tcp4 192.168.1.71:22 192.168.1.195:56445 root sshd 1586 6 tcp6 *:22 *:* root sshd 1586 7 tcp4 *:22 *:*
Here is the output with the patch applied:
tuexen@head:~/freebsd-src/usr.bin/sockstat % sockstat -Ptcp,sctp USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS tuexen nc 1671 3 sctp4 127.0.0.1:10061 127.0.0.1:1234 ?? ?? ?? ?? ?? 192.168.1.71:10061 ?? tuexen nc 1670 3 sctp4 127.0.0.1:1234 *:* tuexen nc 1670 4 sctp4 127.0.0.1:1234 127.0.0.1:10061 ?? ?? ?? ?? ?? ?? 192.168.1.71:10061 tuexen sshd-sessi 1661 7 tcp4 192.168.1.71:22 192.168.1.195:56451 root sshd-sessi 1659 7 tcp4 192.168.1.71:22 192.168.1.195:56451 tuexen sshd-sessi 1654 7 tcp4 192.168.1.71:22 192.168.1.195:56448 root sshd-sessi 1652 7 tcp4 192.168.1.71:22 192.168.1.195:56448 tuexen sshd-sessi 1647 7 tcp4 192.168.1.71:22 192.168.1.195:56445 root sshd-sessi 1645 7 tcp4 192.168.1.71:22 192.168.1.195:56445 root sshd 1586 6 tcp6 *:22 *:* root sshd 1586 7 tcp4 *:22 *:*