summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-07-01 14:22:21 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-07-01 14:22:21 +0000
commitaaea1824222602172b6be35c07e69f787874fe18 (patch)
treeefb72381ea5c87a4e707c8737499b593572dfcb9
parent8cae36a25d4192d6fe5b5e7536a7368f9b46e164 (diff)
Do not access queue fields directly, use FOREACH() macro instead.
No binary change. OK mikeb@ mpi@
-rw-r--r--sys/netinet6/nd6.h5
-rw-r--r--sys/netinet6/nd6_rtr.c9
2 files changed, 4 insertions, 10 deletions
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 310347d3c95..8825557dab5 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.h,v 1.30 2013/03/11 14:08:04 mpi Exp $ */
+/* $OpenBSD: nd6.h,v 1.31 2013/07/01 14:22:20 bluhm Exp $ */
/* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */
/*
@@ -270,8 +270,6 @@ struct nd_prefix {
int ndpr_refcnt; /* reference counter from addresses */
};
-#define ndpr_next ndpr_entry.le_next
-
#define ndpr_raf ndpr_flags
#define ndpr_raf_onlink ndpr_flags.onlink
#define ndpr_raf_auto ndpr_flags.autonomous
@@ -305,7 +303,6 @@ struct inet6_ndpr_msghdr {
struct nd_pfxrouter {
LIST_ENTRY(nd_pfxrouter) pfr_entry;
-#define pfr_next pfr_entry.le_next
struct nd_defrouter *router;
};
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 83fb6dfd0ef..a0393f3670c 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.71 2013/07/01 13:06:24 bluhm Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.72 2013/07/01 14:22:20 bluhm Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -890,9 +890,7 @@ purge_detached(struct ifnet *ifp)
struct in6_ifaddr *ia;
struct ifaddr *ifa, *ifa_next;
- for (pr = nd_prefix.lh_first; pr; pr = pr_next) {
- pr_next = pr->ndpr_next;
-
+ LIST_FOREACH_SAFE(pr, &nd_prefix, ndpr_entry, pr_next) {
/*
* This function is called when we need to make more room for
* new prefixes rather than keeping old, possibly stale ones.
@@ -906,8 +904,7 @@ purge_detached(struct ifnet *ifp)
!LIST_EMPTY(&pr->ndpr_advrtrs)))
continue;
- for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = ifa_next) {
- ifa_next = ifa->ifa_list.tqe_next;
+ TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrlist, ifa_list, ifa_next) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia = ifatoia6(ifa);