mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
sockstat: fix column length for PROTO
The computation of the length was not taking into account that IPv6 endpoints, which are not IPv6 only, have a suffix of 46. For UDP and TCP this bug was not relevant, since tcp46 and udp46 has the same length as PROTO, but sctp46 is longer. Upcoming udplite support will also be affected. Reviewed by: asomers MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53212
This commit is contained in:
1 parent
a2838e818c
commit
4ee0ddae1d
1 file changed
+3
-1
@@ -1196,7 +1196,9 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s)
|
||||
first = true;
|
||||
|
||||
len = strlen(s->protoname);
|
||||
if (s->vflag & (INP_IPV4 | INP_IPV6))
|
||||
if (s->vflag & INP_IPV4)
|
||||
len += 1;
|
||||
if (s->vflag & INP_IPV6)
|
||||
len += 1;
|
||||
cw->proto = MAX(cw->proto, len);
|
||||
|
||||
|
||||
Reference in new issue
Block a user