From ebe2a5b78b2965a3e89ad5e36383d886999bc947 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 10 Mar 1999 17:25:42 +0000 Subject: 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 --- usr.bin/netstat/inet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.bin/netstat/inet.c') 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 @@ -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) { -- cgit v1.1