From 87a5fb27fc6e651b8abafa30796d5b84e4ce2e72 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 9 Apr 1995 15:21:08 +0000 Subject: [PATCH] Updated for 4.4BSD queue macros. (Oops, I forgot to commit this last night; sorry Jordan). --- usr.bin/systat/netcmds.c | 1 + usr.bin/systat/netstat.c | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c index 3790c2a6b947..584b7804ddcb 100644 --- a/usr.bin/systat/netcmds.c +++ b/usr.bin/systat/netcmds.c @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; #include #include #include +#include #include #include diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 0303bf52ad49..cf39f2b73fc3 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 #include #include +#include #include #include @@ -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))