diff options
author | dg <dg@FreeBSD.org> | 1995-04-09 15:21:08 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-04-09 15:21:08 +0000 |
commit | 87a5fb27fc6e651b8abafa30796d5b84e4ce2e72 (patch) | |
tree | d638ae75e1661b9b33071f9878122badd82f68e9 /usr.bin/systat | |
parent | ed7f6aebaf1534af96e9f1bb5c676877f5895067 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.bin/systat/netcmds.c | 1 | ||||
-rw-r--r-- | 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 3790c2a..584b780 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 <sys/socketvar.h> #include <sys/mbuf.h> #include <sys/protosw.h> +#include <sys/queue.h> #include <net/route.h> #include <netinet/in.h> 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)) |