[Bug 297448] sockstat: IPv6 addresses are silently truncated in the default output

[email protected]
Newsgroups gmane.os.freebsd.devel.net
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297448

Rafael Grether <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #273707|                            |maintainer-approval?
              Flags|                            |

--- Comment #3 from Rafael Grether <[email protected]> ---
Created attachment 273707
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=273707&action=edit
Removing the precision of local and foreign address

Hi Michael,

Ellipsis is better than silent truncation, but for an IPv6 addresses it still
hide the most useful part, and I don't think the default output should ever
lose data.

Removing the precision is the right fix, IMO. I restored the same behaviour
displaysock() had before the column sizing rework. Misaligned yes, but
functional.

root nginx      95741  7 tcp4    78.46.37.42:80        *:*
root nginx      95741  8 tcp4    78.46.37.42:443       *:*
root nginx      95741 12 tcp6    [2a01:4f8:110:314e::1]:80 *:*
root nginx      95741 13 tcp6    [2a01:4f8:110:314e::1]:443 *:*

Without truncation, the 21-char minimum is purely cosmetic. Raising it alone
indeed doesn't solve the problem, but dropping the precision does. Nothing is
ever lost.

Agreed on the 16/17 plan for -w.

Patch attached. Or did you prefer I submit a review on phabricator ?
If so, please let me know.

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.