Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6.c
| Show First 20 Lines • Show All 1,324 Lines • ▼ Show 20 Lines | if ((pr = nd6_prefix_lookup(&pr0)) == NULL) { | ||||
| * nd6_prelist_add will install the corresponding | * nd6_prelist_add will install the corresponding | ||||
| * interface route. | * interface route. | ||||
| */ | */ | ||||
| if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) { | if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) { | ||||
| if (carp_attached) | if (carp_attached) | ||||
| (*carp_detach_p)(&ia->ia_ifa, false); | (*carp_detach_p)(&ia->ia_ifa, false); | ||||
| goto out; | goto out; | ||||
| } | } | ||||
| } else if (pr->ndpr_raf_onlink) { | |||||
| time_t expiry; | |||||
| /* | |||||
| * If the prefix already exists, update lifetimes, but avoid | |||||
| * shortening them. | |||||
| */ | |||||
| ND6_WLOCK(); | |||||
| expiry = in6_expire_time(pr0.ndpr_pltime); | |||||
| if (pr->ndpr_preferred != 0 && | |||||
| (pr->ndpr_preferred < expiry || expiry == 0)) { | |||||
| pr->ndpr_pltime = pr0.ndpr_pltime; | |||||
| pr->ndpr_preferred = expiry; | |||||
| } | |||||
| expiry = in6_expire_time(pr0.ndpr_vltime); | |||||
| if (pr->ndpr_expire != 0 && | |||||
| (pr->ndpr_expire < expiry || expiry == 0)) { | |||||
| pr->ndpr_vltime = pr0.ndpr_vltime; | |||||
| pr->ndpr_expire = expiry; | |||||
| } | |||||
| pr->ndpr_lastupdate = time_uptime; | |||||
| ND6_WUNLOCK(); | |||||
| } | } | ||||
| /* relate the address to the prefix */ | /* relate the address to the prefix */ | ||||
| if (ia->ia6_ndpr == NULL) { | if (ia->ia6_ndpr == NULL) { | ||||
| ia->ia6_ndpr = pr; | ia->ia6_ndpr = pr; | ||||
| pr->ndpr_addrcnt++; | pr->ndpr_addrcnt++; | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 1,395 Lines • Show Last 20 Lines | |||||