summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/netstat.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-09 15:21:08 +0000
committerdg <dg@FreeBSD.org>1995-04-09 15:21:08 +0000
commit87a5fb27fc6e651b8abafa30796d5b84e4ce2e72 (patch)
treed638ae75e1661b9b33071f9878122badd82f68e9 /usr.bin/systat/netstat.c
parented7f6aebaf1534af96e9f1bb5c676877f5895067 (diff)
downloadFreeBSD-src-87a5fb27fc6e651b8abafa30796d5b84e4ce2e72.zip
FreeBSD-src-87a5fb27fc6e651b8abafa30796d5b84e4ce2e72.tar.gz
Updated for 4.4BSD queue macros. (Oops, I forgot to commit this last night;
sorry Jordan).
Diffstat (limited to 'usr.bin/systat/netstat.c')
-rw-r--r--usr.bin/systat/netstat.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index 0303bf5..cf39f2b 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93";
#include <sys/socketvar.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <netinet/in.h>
#include <net/route.h>
@@ -164,6 +165,7 @@ fetchnetstat()
{
register struct inpcb *prev, *next;
register struct netinfo *p;
+ struct inpcbhead head;
struct inpcb inpcb;
struct socket sockb;
struct tcpcb tcpcb;
@@ -187,18 +189,9 @@ fetchnetstat()
return;
}
again:
- KREAD(off, &inpcb, sizeof (struct inpcb));
- prev = off;
- for (; inpcb.inp_next != off; prev = next) {
- next = inpcb.inp_next;
+ KREAD(off, &head, sizeof (struct inpcbhead));
+ for (next = head.lh_first; next != NULL; next = inpcb.inp_list.le_next) {
KREAD(next, &inpcb, sizeof (inpcb));
- if (inpcb.inp_prev != prev) {
- p = netcb.ni_forw;
- for (; p != (struct netinfo *)&netcb; p = p->ni_forw)
- p->ni_seen = 1;
- error("Kernel state in transition");
- return;
- }
if (!aflag && inet_lnaof(inpcb.inp_laddr) == INADDR_ANY)
continue;
if (nhosts && !checkhost(&inpcb))
OpenPOWER on IntegriCloud