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)
Sun, Oct 27, 9:50 PM
Unknown Object (File)
Oct 5 2024, 12:33 PM
Unknown Object (File)
Oct 5 2024, 4:51 AM
Unknown Object (File)
Oct 2 2024, 11:52 AM
Unknown Object (File)
Oct 2 2024, 11:06 AM
Unknown Object (File)
Oct 1 2024, 1:29 AM
Unknown Object (File)
Oct 1 2024, 12:29 AM
Unknown Object (File)
Sep 30 2024, 3:17 PM
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