Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/nd6_nbr.c
Show First 20 Lines • Show All 1,335 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
nd6_dad_timer(void *arg) | nd6_dad_timer(void *arg) | ||||
{ | { | ||||
struct dadq *dp = arg; | struct dadq *dp = arg; | ||||
struct ifaddr *ifa = dp->dad_ifa; | struct ifaddr *ifa = dp->dad_ifa; | ||||
struct ifnet *ifp = dp->dad_ifa->ifa_ifp; | struct ifnet *ifp = dp->dad_ifa->ifa_ifp; | ||||
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; | struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; | ||||
struct nd_ifinfo *ndi; | |||||
char ip6buf[INET6_ADDRSTRLEN]; | char ip6buf[INET6_ADDRSTRLEN]; | ||||
struct epoch_tracker et; | struct epoch_tracker et; | ||||
CURVNET_SET(dp->dad_vnet); | CURVNET_SET(dp->dad_vnet); | ||||
KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); | KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); | ||||
NET_EPOCH_ENTER(et); | NET_EPOCH_ENTER(et); | ||||
if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { | if ((ndi = nd6_ifinfo(ifp)) == NULL || | ||||
(ndi->flags & ND6_IFF_IFDISABLED) != 0) { | |||||
/* Do not need DAD for ifdisabled interface. */ | /* Do not need DAD for ifdisabled interface. */ | ||||
log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of " | log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of " | ||||
"ND6_IFF_IFDISABLED.\n", ifp->if_xname); | "ND6_IFF_IFDISABLED.\n", ifp->if_xname); | ||||
goto err; | goto err; | ||||
} | } | ||||
if (ia->ia6_flags & IN6_IFF_DUPLICATED) { | if (ia->ia6_flags & IN6_IFF_DUPLICATED) { | ||||
log(LOG_ERR, "nd6_dad_timer: called with duplicated address " | log(LOG_ERR, "nd6_dad_timer: called with duplicated address " | ||||
"%s(%s)\n", | "%s(%s)\n", | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) { | ||||
goto done; | goto done; | ||||
} else { | } else { | ||||
/* | /* | ||||
* We are done with DAD. No NA came, no NS came. | * We are done with DAD. No NA came, no NS came. | ||||
* No duplicate address found. Check IFDISABLED flag | * No duplicate address found. Check IFDISABLED flag | ||||
* again in case that it is changed between the | * again in case that it is changed between the | ||||
* beginning of this function and here. | * beginning of this function and here. | ||||
*/ | */ | ||||
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) == 0) | if ((ndi->flags & ND6_IFF_IFDISABLED) == 0) | ||||
ia->ia6_flags &= ~IN6_IFF_TENTATIVE; | ia->ia6_flags &= ~IN6_IFF_TENTATIVE; | ||||
nd6log((LOG_DEBUG, | nd6log((LOG_DEBUG, | ||||
"%s: DAD complete for %s - no duplicates found\n", | "%s: DAD complete for %s - no duplicates found\n", | ||||
if_name(ifa->ifa_ifp), | if_name(ifa->ifa_ifp), | ||||
ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); | ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); | ||||
if (dp->dad_ns_lcount > 0) | if (dp->dad_ns_lcount > 0) | ||||
log(LOG_ERR, "%s: DAD completed while " | log(LOG_ERR, "%s: DAD completed while " | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |