From dc2b77c5c209a007b4fbb3168795820a9b050aec Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 13 Jan 2010 02:13:13 +0000 Subject: instead of fiddling with the per-interface address lists directly in many places create a proper API (ifa_add / ifa_del) and use it. ok theo ryan dlg --- sys/netinet6/in6.c | 7 +++---- sys/netinet6/in6_ifattach.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index a21dc09b4d8..5c0eb087d1f 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.84 2010/01/13 02:02:43 henning Exp $ */ +/* $OpenBSD: in6.c,v 1.85 2010/01/13 02:13:12 henning Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -944,8 +944,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, } else in6_ifaddr = ia; ia->ia_addr = ifra->ifra_addr; - TAILQ_INSERT_TAIL(&ifp->if_addrlist, &ia->ia_ifa, - ifa_list); + ifa_add(ifp, &ia->ia_ifa); } /* set prefix mask */ @@ -1277,7 +1276,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp) struct in6_ifaddr *oia; int s = splnet(); - TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list); + ifa_del(ifp, &ia->ia_ifa); oia = ia; if (oia == (ia = in6_ifaddr)) diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index a49927ebca7..6d0321d9b47 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.48 2009/01/30 10:47:46 mcbride Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.49 2010/01/13 02:13:12 henning Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -697,7 +697,7 @@ in6_ifdetach(struct ifnet *ifp) } /* remove from the linked list */ - TAILQ_REMOVE(&ifp->if_addrlist, (struct ifaddr *)ia, ifa_list); + ifa_del(ifp, (struct ifaddr *)ia); IFAFREE(&ia->ia_ifa); /* also remove from the IPv6 address chain(itojun&jinmei) */ -- cgit v1.2.3