Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/nd6.c
Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | while (1) { | ||||
if (nd_opt == NULL) | if (nd_opt == NULL) | ||||
goto skip1; | goto skip1; | ||||
switch (nd_opt->nd_opt_type) { | switch (nd_opt->nd_opt_type) { | ||||
case ND_OPT_SOURCE_LINKADDR: | case ND_OPT_SOURCE_LINKADDR: | ||||
case ND_OPT_TARGET_LINKADDR: | case ND_OPT_TARGET_LINKADDR: | ||||
case ND_OPT_MTU: | case ND_OPT_MTU: | ||||
case ND_OPT_REDIRECTED_HEADER: | case ND_OPT_REDIRECTED_HEADER: | ||||
case ND_OPT_NONCE: | |||||
if (ndopts->nd_opt_array[nd_opt->nd_opt_type]) { | if (ndopts->nd_opt_array[nd_opt->nd_opt_type]) { | ||||
nd6log((LOG_INFO, | nd6log((LOG_INFO, | ||||
"duplicated ND6 option found (type=%d)\n", | "duplicated ND6 option found (type=%d)\n", | ||||
nd_opt->nd_opt_type)); | nd_opt->nd_opt_type)); | ||||
/* XXX bark? */ | /* XXX bark? */ | ||||
} else { | } else { | ||||
ndopts->nd_opt_array[nd_opt->nd_opt_type] | ndopts->nd_opt_array[nd_opt->nd_opt_type] | ||||
= nd_opt; | = nd_opt; | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | nd6_llinfo_timer(void *arg) | ||||
} | } | ||||
switch (ln->ln_state) { | switch (ln->ln_state) { | ||||
case ND6_LLINFO_INCOMPLETE: | case ND6_LLINFO_INCOMPLETE: | ||||
if (ln->la_asked < V_nd6_mmaxtries) { | if (ln->la_asked < V_nd6_mmaxtries) { | ||||
ln->la_asked++; | ln->la_asked++; | ||||
nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | ||||
LLE_WUNLOCK(ln); | LLE_WUNLOCK(ln); | ||||
nd6_ns_output(ifp, NULL, dst, ln, 0); | nd6_ns_output(ifp, NULL, dst, ln, NULL); | ||||
LLE_WLOCK(ln); | LLE_WLOCK(ln); | ||||
} else { | } else { | ||||
struct mbuf *m = ln->la_hold; | struct mbuf *m = ln->la_hold; | ||||
if (m) { | if (m) { | ||||
struct mbuf *m0; | struct mbuf *m0; | ||||
/* | /* | ||||
* assuming every packet in la_hold has the | * assuming every packet in la_hold has the | ||||
Show All 30 Lines | nd6_llinfo_timer(void *arg) | ||||
case ND6_LLINFO_DELAY: | case ND6_LLINFO_DELAY: | ||||
if (ndi && (ndi->flags & ND6_IFF_PERFORMNUD) != 0) { | if (ndi && (ndi->flags & ND6_IFF_PERFORMNUD) != 0) { | ||||
/* We need NUD */ | /* We need NUD */ | ||||
ln->la_asked = 1; | ln->la_asked = 1; | ||||
ln->ln_state = ND6_LLINFO_PROBE; | ln->ln_state = ND6_LLINFO_PROBE; | ||||
nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | ||||
LLE_WUNLOCK(ln); | LLE_WUNLOCK(ln); | ||||
nd6_ns_output(ifp, dst, dst, ln, 0); | nd6_ns_output(ifp, dst, dst, ln, NULL); | ||||
LLE_WLOCK(ln); | LLE_WLOCK(ln); | ||||
} else { | } else { | ||||
ln->ln_state = ND6_LLINFO_STALE; /* XXX */ | ln->ln_state = ND6_LLINFO_STALE; /* XXX */ | ||||
nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); | nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); | ||||
} | } | ||||
break; | break; | ||||
case ND6_LLINFO_PROBE: | case ND6_LLINFO_PROBE: | ||||
if (ln->la_asked < V_nd6_umaxtries) { | if (ln->la_asked < V_nd6_umaxtries) { | ||||
ln->la_asked++; | ln->la_asked++; | ||||
nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); | ||||
LLE_WUNLOCK(ln); | LLE_WUNLOCK(ln); | ||||
nd6_ns_output(ifp, dst, dst, ln, 0); | nd6_ns_output(ifp, dst, dst, ln, NULL); | ||||
LLE_WLOCK(ln); | LLE_WLOCK(ln); | ||||
} else { | } else { | ||||
EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); | EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); | ||||
(void)nd6_free(ln, 0); | (void)nd6_free(ln, 0); | ||||
ln = NULL; | ln = NULL; | ||||
} | } | ||||
break; | break; | ||||
default: | default: | ||||
▲ Show 20 Lines • Show All 1,482 Lines • ▼ Show 20 Lines | nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m, | ||||
* INCOMPLETE state, send the first solicitation. | * INCOMPLETE state, send the first solicitation. | ||||
*/ | */ | ||||
if (!ND6_LLINFO_PERMANENT(lle) && lle->la_asked == 0) { | if (!ND6_LLINFO_PERMANENT(lle) && lle->la_asked == 0) { | ||||
lle->la_asked++; | lle->la_asked++; | ||||
nd6_llinfo_settimer_locked(lle, | nd6_llinfo_settimer_locked(lle, | ||||
(long)ND_IFINFO(ifp)->retrans * hz / 1000); | (long)ND_IFINFO(ifp)->retrans * hz / 1000); | ||||
LLE_WUNLOCK(lle); | LLE_WUNLOCK(lle); | ||||
nd6_ns_output(ifp, NULL, &dst->sin6_addr, lle, 0); | nd6_ns_output(ifp, NULL, &dst->sin6_addr, lle, NULL); | ||||
} else { | } else { | ||||
/* We did the lookup so we need to do the unlock here. */ | /* We did the lookup so we need to do the unlock here. */ | ||||
LLE_WUNLOCK(lle); | LLE_WUNLOCK(lle); | ||||
} | } | ||||
return (0); | return (0); | ||||
sendpkt: | sendpkt: | ||||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |