diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2005-01-02 19:26:06 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2005-01-02 19:26:06 +0000 |
commit | f6a9459c8d8823575d73405b9671627d6b1689a4 (patch) | |
tree | f791ec2522838be97e4adfc913b4cbaf091139ab /usr.bin/netstat | |
parent | f6832a8239fc87f5830835e5df16944a9845bf1c (diff) | |
download | src-f6a9459c8d8823575d73405b9671627d6b1689a4.tar.gz src-f6a9459c8d8823575d73405b9671627d6b1689a4.zip |
evise use of queue(9) macros for netipx when used from userspace:
LIST_FOREACH() is difficult to use correctly, so don't try to.
Notes
Notes:
svn path=/head/; revision=139594
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/ipx.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c index d067b9e06112..04ba023ee399 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; |