From e4ec3989d9cfdd13788c42b55ce9a411f9bfc47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 10 Mar 1999 17:25:42 +0000 Subject: [PATCH] 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(-) diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 314ada559f81..ec5d4c9289b8 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) {