Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/nd6_nbr.c
Show First 20 Lines • Show All 624 Lines • ▼ Show 20 Lines | nd6_na_input(struct mbuf *m, int off, int icmp6len) | ||||
struct in6_addr daddr6, taddr6; | struct in6_addr daddr6, taddr6; | ||||
union nd_opts ndopts; | union nd_opts ndopts; | ||||
u_char linkhdr[LLE_MAX_LINKHDR]; | u_char linkhdr[LLE_MAX_LINKHDR]; | ||||
char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; | char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; | ||||
char *lladdr; | char *lladdr; | ||||
size_t linkhdrsize; | size_t linkhdrsize; | ||||
int flags, is_override, is_router, is_solicited; | int flags, is_override, is_router, is_solicited; | ||||
int lladdr_off, lladdrlen, checklink; | int lladdr_off, lladdrlen, checklink; | ||||
bool flush_holdchain = false; | |||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
chain = NULL; | chain = NULL; | ||||
ln = NULL; | ln = NULL; | ||||
checklink = 0; | checklink = 0; | ||||
/* RFC 6980: Nodes MUST silently ignore fragments */ | /* RFC 6980: Nodes MUST silently ignore fragments */ | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | nd6log((LOG_INFO, "nd6_na_input: lladdrlen mismatch for %s " | ||||
ifp->if_addrlen, lladdrlen - 2)); | ifp->if_addrlen, lladdrlen - 2)); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
/* | /* | ||||
* If no neighbor cache entry is found, NA SHOULD silently be | * If no neighbor cache entry is found, NA SHOULD silently be | ||||
* discarded. | * discarded. | ||||
*/ | */ | ||||
ln = nd6_lookup(&taddr6, LLE_EXCLUSIVE, ifp); | ln = nd6_lookup(&taddr6, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); | ||||
if (ln == NULL) { | if (ln == NULL) { | ||||
goto freeit; | goto freeit; | ||||
} | } | ||||
/* | /* | ||||
* Do not try to override static entry. | * Do not try to override static entry. | ||||
*/ | */ | ||||
if (ln->la_flags & LLE_STATIC) | if (ln->la_flags & LLE_STATIC) | ||||
Show All 9 Lines | if (ln->ln_state == ND6_LLINFO_INCOMPLETE) { | ||||
} | } | ||||
/* | /* | ||||
* Record link-layer address, and update the state. | * Record link-layer address, and update the state. | ||||
*/ | */ | ||||
if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) | if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) | ||||
goto freeit; | goto freeit; | ||||
flush_holdchain = true; | |||||
EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); | EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); | ||||
if (is_solicited) | if (is_solicited) | ||||
nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE); | nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE); | ||||
else | else | ||||
nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); | nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); | ||||
if ((ln->ln_router = is_router) != 0) { | if ((ln->ln_router = is_router) != 0) { | ||||
/* | /* | ||||
* This means a router's state has changed from | * This means a router's state has changed from | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | nd6_na_input(struct mbuf *m, int off, int icmp6len) | ||||
if (ln->la_hold != NULL) | if (ln->la_hold != NULL) | ||||
chain = nd6_grab_holdchain(ln); | chain = nd6_grab_holdchain(ln); | ||||
freeit: | freeit: | ||||
if (ln != NULL) | if (ln != NULL) | ||||
LLE_WUNLOCK(ln); | LLE_WUNLOCK(ln); | ||||
if (chain != NULL) | if (chain != NULL) | ||||
nd6_flush_holdchain(ifp, ln, chain); | nd6_flush_holdchain(ifp, ln, chain); | ||||
if (flush_holdchain) | |||||
nd6_flush_children_holdchain(ifp, ln); | |||||
if (checklink) | if (checklink) | ||||
pfxlist_onlink_check(); | pfxlist_onlink_check(); | ||||
m_freem(m); | m_freem(m); | ||||
return; | return; | ||||
bad: | bad: | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |