Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6.c
Context not available. | |||||
} | } | ||||
ia->ia_ifp = ifp; | ia->ia_ifp = ifp; | ||||
ifa_ref(&ia->ia_ifa); /* if_addrhead */ | if (ifa_ref(&ia->ia_ifa) != 0) { | ||||
IF_ADDR_WLOCK(ifp); | IF_ADDR_WLOCK(ifp); | ||||
CK_STAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); | CK_STAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); | ||||
IF_ADDR_WUNLOCK(ifp); | IF_ADDR_WUNLOCK(ifp); | ||||
} | |||||
ifa_ref(&ia->ia_ifa); /* in6_ifaddrhead */ | if (ifa_ref(&ia->ia_ifa) != 0) { | ||||
IN6_IFADDR_WLOCK(); | IN6_IFADDR_WLOCK(); | ||||
CK_STAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link); | CK_STAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link); | ||||
CK_LIST_INSERT_HEAD(IN6ADDR_HASH(&ia->ia_addr.sin6_addr), ia, ia6_hash); | CK_LIST_INSERT_HEAD(IN6ADDR_HASH(&ia->ia_addr.sin6_addr), ia, ia6_hash); | ||||
IN6_IFADDR_WUNLOCK(); | IN6_IFADDR_WUNLOCK(); | ||||
} | |||||
return (ia); | return (ia); | ||||
} | } | ||||
Context not available. | |||||
continue; | continue; | ||||
if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) { | if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) { | ||||
if ((((struct in6_ifaddr *)ifa)->ia6_flags & | if ((((struct in6_ifaddr *)ifa)->ia6_flags & | ||||
ignoreflags) != 0) | ignoreflags) == 0 && ifa_ref(ifa) != 0) | ||||
continue; | break; | ||||
ifa_ref(ifa); | |||||
break; | |||||
} | } | ||||
} | } | ||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
Context not available. | |||||
if (zoneid != 0 && | if (zoneid != 0 && | ||||
zoneid != ia->ia_addr.sin6_scope_id) | zoneid != ia->ia_addr.sin6_scope_id) | ||||
continue; | continue; | ||||
ifa_ref(&ia->ia_ifa); | if (ifa_ref(&ia->ia_ifa) != 0) | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); | IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); | ||||
Context not available. | |||||
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | ||||
if (ifa->ifa_addr->sa_family != AF_INET6) | if (ifa->ifa_addr->sa_family != AF_INET6) | ||||
continue; | continue; | ||||
if (IN6_ARE_ADDR_EQUAL(addr, IFA_IN6(ifa))) { | if (IN6_ARE_ADDR_EQUAL(addr, IFA_IN6(ifa)) && | ||||
ifa_ref(ifa); | ifa_ref(ifa) != 0) | ||||
break; | break; | ||||
} | |||||
} | } | ||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
Context not available. | |||||
besta = (struct in6_ifaddr *)ifa; | besta = (struct in6_ifaddr *)ifa; | ||||
} | } | ||||
} | } | ||||
if (besta) { | if (besta && ifa_ref(&besta->ia_ifa) != 0) { | ||||
ifa_ref(&besta->ia_ifa); | |||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
return (besta); | return (besta); | ||||
} | } | ||||
Context not available. | |||||
dep[1] = (struct in6_ifaddr *)ifa; | dep[1] = (struct in6_ifaddr *)ifa; | ||||
continue; | continue; | ||||
} | } | ||||
if (ifa_ref(ifa) == 0) | |||||
if (ifa != NULL) | continue; | ||||
ifa_ref(ifa); | |||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
return (struct in6_ifaddr *)ifa; | return (struct in6_ifaddr *)ifa; | ||||
} | } | ||||
/* use the last-resort values, that are, deprecated addresses */ | /* use the last-resort values, that are, deprecated addresses */ | ||||
if (dep[0]) { | if (dep[0] && ifa_ref((struct ifaddr *)dep[0]) != 0) { | ||||
ifa_ref((struct ifaddr *)dep[0]); | |||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
return dep[0]; | return dep[0]; | ||||
} | } | ||||
if (dep[1]) { | if (dep[1] && ifa_ref((struct ifaddr *)dep[1]) != 0) { | ||||
ifa_ref((struct ifaddr *)dep[1]); | |||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
return dep[1]; | return dep[1]; | ||||
} | } | ||||
Context not available. |