diff options
author | des <des@FreeBSD.org> | 1999-03-10 17:25:42 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1999-03-10 17:25:42 +0000 |
commit | ebe2a5b78b2965a3e89ad5e36383d886999bc947 (patch) | |
tree | 9a534f796152a48ce0721f225ccabdbbd917cce5 /usr.bin/netstat/inet.c | |
parent | c346790f67fead19172ab7bb3c8de293882079a3 (diff) | |
download | FreeBSD-src-ebe2a5b78b2965a3e89ad5e36383d886999bc947.zip FreeBSD-src-ebe2a5b78b2965a3e89ad5e36383d886999bc947.tar.gz |
Fix fstat compatibility by printing the address of the tcppcb instead of
that of the regular socket pcb for TCP sockets.
PR: bin/9963
Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua>
Diffstat (limited to 'usr.bin/netstat/inet.c')
-rw-r--r-- | usr.bin/netstat/inet.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 314ada5..ec5d4c9 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95"; */ static const char rcsid[] = - "$Id: inet.c,v 1.29 1998/06/09 04:13:01 imp Exp $"; + "$Id: inet.c,v 1.30 1998/07/06 21:01:23 bde Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -170,8 +170,12 @@ protopr(proto, name) "Local Address", "Foreign Address", "(state)"); first = 0; } - if (Aflag) - printf("%8lx ", (u_long)so->so_pcb); + if (Aflag) { + if (istcp) + printf("%8lx ", (u_long)inp->inp_ppcb); + else + printf("%8lx ", (u_long)so->so_pcb); + } printf("%-5.5s %6ld %6ld ", name, so->so_rcv.sb_cc, so->so_snd.sb_cc); if (nflag) { |