Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/nd6.c
Show First 20 Lines • Show All 2,107 Lines • ▼ Show 20 Lines | if ((type & 0xFF) == ND_REDIRECT && code != ND_REDIRECT_ROUTER) | ||||
ln->la_flags |= LLE_REDIRECT; | ln->la_flags |= LLE_REDIRECT; | ||||
if (flags & LLE_EXCLUSIVE) | if (flags & LLE_EXCLUSIVE) | ||||
LLE_WUNLOCK(ln); | LLE_WUNLOCK(ln); | ||||
else | else | ||||
LLE_RUNLOCK(ln); | LLE_RUNLOCK(ln); | ||||
if (chain != NULL) | if (chain != NULL) | ||||
nd6_flush_holdchain(ifp, ifp, chain, &sin6); | nd6_flush_holdchain(ifp, chain, &sin6); | ||||
/* | /* | ||||
* When the link-layer address of a router changes, select the | * When the link-layer address of a router changes, select the | ||||
* best router again. In particular, when the neighbor entry is newly | * best router again. In particular, when the neighbor entry is newly | ||||
* created, it might affect the selection policy. | * created, it might affect the selection policy. | ||||
* Question: can we restrict the first condition to the "is_newentry" | * Question: can we restrict the first condition to the "is_newentry" | ||||
* case? | * case? | ||||
* XXX: when we hear an RA from a new router with the link-layer | * XXX: when we hear an RA from a new router with the link-layer | ||||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, | ||||
flags |= LLE_ADDRONLY; | flags |= LLE_ADDRONLY; | ||||
error = nd6_resolve_slow(ifp, flags, NULL, | error = nd6_resolve_slow(ifp, flags, NULL, | ||||
(const struct sockaddr_in6 *)dst, desten, pflags, NULL); | (const struct sockaddr_in6 *)dst, desten, pflags, NULL); | ||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
nd6_flush_holdchain(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain, | nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain, | ||||
struct sockaddr_in6 *dst) | struct sockaddr_in6 *dst) | ||||
{ | { | ||||
struct mbuf *m, *m_head; | struct mbuf *m, *m_head; | ||||
struct ifnet *outifp; | |||||
int error = 0; | int error = 0; | ||||
m_head = chain; | m_head = chain; | ||||
if ((ifp->if_flags & IFF_LOOPBACK) != 0) | |||||
outifp = origifp; | |||||
else | |||||
outifp = ifp; | |||||
while (m_head) { | while (m_head) { | ||||
m = m_head; | m = m_head; | ||||
m_head = m_head->m_nextpkt; | m_head = m_head->m_nextpkt; | ||||
error = nd6_output_ifp(ifp, origifp, m, dst, NULL); | error = nd6_output_ifp(ifp, ifp, m, dst, NULL); | ||||
} | } | ||||
/* | /* | ||||
* XXX | * XXX | ||||
* note that intermediate errors are blindly ignored | * note that intermediate errors are blindly ignored | ||||
*/ | */ | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
nd6_need_cache(struct ifnet *ifp) | nd6_need_cache(struct ifnet *ifp) | ||||
{ | { | ||||
/* | /* | ||||
* XXX: we currently do not make neighbor cache on any interface | * XXX: we currently do not make neighbor cache on any interface | ||||
* other than ARCnet, Ethernet, FDDI and GIF. | * other than ARCnet, Ethernet, FDDI and GIF. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |