HomeFreeBSD

netstat: fix printing of TCP pcbs with -A

Description

netstat: fix printing of TCP pcbs with -A

This change touches both kernel and netstat(1), but either of the changes
will fix printing pcb addresses with -A.

The thing is that historically netstat(1) treated TCP differently, and
printed tcpcb address instead of inpcb address. This is not documented
anywhere! With e68b3792440 these two addresses became the same. It is
highly likely they will be the same for a long time, but it might be they
will start to differ again in a far future. My proposal is to stop
treating TCP differently with netstat(1) and right now is a good opportunity
to do that, since there will be no behavior change at all. The kernel
change to tcp_inptoxtp() will go into stable/14 to make it compatible with
netstat(1) binary from stable/13. We can drop it later, probably together
with in_ppcb pointer from inpcb. The in_ppcb in xinpcb will stay for size
compatibility.

Reviewed by: tuexen, rrs
Differential Revision: https://reviews.freebsd.org/D39736

Details

Provenance
glebiusAuthored on Apr 20 2023, 7:41 PM
Reviewer
tuexen
Differential Revision
D39736: netstat: fix printing of TCP pcbs with -A
Parents
rG42140052765e: kern.mk: clang >= 16 already infers ELFv2 for powerpc64
Branches
Unknown
Tags
Unknown