diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-24 21:00:25 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-24 21:00:25 +0000 |
commit | 9c4380a8eea873952968c44b6e2567cd55ba5011 (patch) | |
tree | d5254cdd84bc71793efc3d8e4ce92756811f0fc7 /sys/netinet6/nd6.c | |
parent | cb4def77ea11a26ecabee87b4221b746f96d689d (diff) | |
download | FreeBSD-src-9c4380a8eea873952968c44b6e2567cd55ba5011.zip FreeBSD-src-9c4380a8eea873952968c44b6e2567cd55ba5011.tar.gz |
Convert netinet6 to using queue(9) rather than hand-crafted linked lists
for the global IPv6 address list (in6_ifaddr -> in6_ifaddrhead). Adopt
the code styles and conventions present in netinet where possible.
Reviewed by: gnn, bz
MFC after: 6 weeks (possibly not MFCable?)
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r-- | sys/netinet6/nd6.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index e5fa6ae2..8cfb135 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -626,8 +626,7 @@ nd6_timer(void *arg) * rather separate address lifetimes and prefix lifetimes. */ addrloop: - for (ia6 = V_in6_ifaddr; ia6; ia6 = nia6) { - nia6 = ia6->ia_next; + TAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) { /* check address lifetime */ lt6 = &ia6->ia6_lifetime; if (IFA6_IS_INVALID(ia6)) { @@ -1329,10 +1328,8 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) continue; /* XXX */ /* do we really have to remove addresses as well? */ - for (ia = V_in6_ifaddr; ia; ia = ia_next) { - /* ia might be removed. keep the next ptr. */ - ia_next = ia->ia_next; - + TAILQ_FOREACH_SAFE(ia, &V_in6_ifaddrhead, ia_link, + ia_next) { if ((ia->ia6_flags & IN6_IFF_AUTOCONF) == 0) continue; |