summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/netstat.c
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-12-24 08:54:53 +0000
committersilby <silby@FreeBSD.org>2003-12-24 08:54:53 +0000
commitd4e4b731a60d06676a0749fde2558c1b9e00baec (patch)
treeaf5f82ea5be62c8524efc40d1b764ced6aabbea3 /usr.bin/systat/netstat.c
parentb1487e9a601cc3d5417aeefb3ffa1d5a7ffa1392 (diff)
downloadFreeBSD-src-d4e4b731a60d06676a0749fde2558c1b9e00baec.zip
FreeBSD-src-d4e4b731a60d06676a0749fde2558c1b9e00baec.tar.gz
Make systat -net aware of compressed time_wait sockets.
Diffstat (limited to 'usr.bin/systat/netstat.c')
-rw-r--r--usr.bin/systat/netstat.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index 7a6c1bd..f802219 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -211,10 +211,18 @@ again:
continue;
if (nports && !checkport(&inpcb))
continue;
- KREAD(inpcb.inp_socket, &sockb, sizeof (sockb));
if (istcp) {
- KREAD(inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
- enter_kvm(&inpcb, &sockb, tcpcb.t_state, "tcp");
+ if (inpcb.inp_vflag & INP_TIMEWAIT) {
+ bzero(&sockb, sizeof(sockb));
+ enter_kvm(&inpcb, &sockb, TCPS_TIME_WAIT,
+ "tcp");
+ } else {
+ KREAD(inpcb.inp_socket, &sockb,
+ sizeof (sockb));
+ KREAD(inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
+ enter_kvm(&inpcb, &sockb, tcpcb.t_state,
+ "tcp");
+ }
} else
enter_kvm(&inpcb, &sockb, 0, "udp");
}
OpenPOWER on IntegriCloud