summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-01-02 19:26:06 +0000
committerrwatson <rwatson@FreeBSD.org>2005-01-02 19:26:06 +0000
commit13cad23620e00678d1e92fa5fbfb6c363e4cf977 (patch)
treef791ec2522838be97e4adfc913b4cbaf091139ab /usr.bin/netstat
parentaef62f129da0672a222569dd7089c770239b7b32 (diff)
downloadFreeBSD-src-13cad23620e00678d1e92fa5fbfb6c363e4cf977.zip
FreeBSD-src-13cad23620e00678d1e92fa5fbfb6c363e4cf977.tar.gz
evise use of queue(9) macros for netipx when used from userspace:
LIST_FOREACH() is difficult to use correctly, so don't try to.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/ipx.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index d067b9e..04ba023 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -84,7 +84,7 @@ void
ipxprotopr(u_long off, const char *name, int af1 __unused)
{
struct ipxpcbhead cb;
- struct ipxpcb *prev, *ipxp, *next;
+ struct ipxpcb *ipxp;
struct ipxpcb ipxpcb;
struct spxpcb spxpcb;
struct socket sockb;
@@ -96,18 +96,12 @@ ipxprotopr(u_long off, const char *name, int af1 __unused)
isspx = strcmp(name, "spx") == 0;
kread(off, (char *)&cb, sizeof (struct ipxpcbhead));
- next = LIST_FIRST (&cb);
- LIST_FOREACH(ipxp, &cb, ipxp_list) {
+ ipxp = LIST_FIRST(&cb);
+ while (ipxp != NULL) {
u_long ppcb;
- prev = next;
- next = ipxp;
- kread((u_long)next, (char *)&ipxpcb, sizeof (ipxpcb));
-
- if (*ipxpcb.ipxp_list.le_prev != prev) {
- printf("???\n");
- break;
- }
+ kread((u_long)ipxp, (char *)&ipxpcb, sizeof (ipxpcb));
+ ipxp = LIST_NEXT(&ipxpcb, ipxp_list);
if (!aflag && ipx_nullhost(ipxpcb.ipxp_faddr) ) {
continue;
OpenPOWER on IntegriCloud