diff options
author | Mike Silbersack <silby@FreeBSD.org> | 2003-12-24 08:54:53 +0000 |
---|---|---|
committer | Mike Silbersack <silby@FreeBSD.org> | 2003-12-24 08:54:53 +0000 |
commit | ba2bc772d12252e927c40a14cfc8c302c70388be (patch) | |
tree | af5f82ea5be62c8524efc40d1b764ced6aabbea3 /usr.bin | |
parent | 7655ebdaaa5d30cd4eb146aecee456848ac10d98 (diff) | |
download | src-ba2bc772d12252e927c40a14cfc8c302c70388be.tar.gz src-ba2bc772d12252e927c40a14cfc8c302c70388be.zip |
Make systat -net aware of compressed time_wait sockets.
Notes
Notes:
svn path=/head/; revision=123800
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/netstat.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 7a6c1bddccf1..f802219d71fa 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"); } |