Page MenuHomeFreeBSD

netstat: fix printing of TCP pcbs with -A
ClosedPublic

Authored by glebius on Apr 20 2023, 7:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 5:19 PM
Unknown Object (File)
Mon, Apr 22, 4:32 PM
Unknown Object (File)
Mon, Apr 22, 10:29 AM
Unknown Object (File)
Fri, Apr 5, 5:33 PM
Unknown Object (File)
Jan 31 2024, 2:17 AM
Unknown Object (File)
Dec 20 2023, 7:23 AM
Unknown Object (File)
Dec 15 2023, 3:14 AM
Unknown Object (File)
Dec 11 2023, 6:43 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable