Lines Matching defs:new
627 struct nd_pfxrouter *new;
639 new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO);
640 if (new == NULL)
643 new->router = dr;
647 LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry);
652 free(new, M_IP6NDP);
674 defrouter_addreq(struct nd_defrouter *new)
689 gate.sin6_addr = new->rtaddr;
690 fibnum = new->ifp->if_fib;
703 new->installed = 1;
787 * If the router is the primary one, choose a new one.
1005 * We only prefer the new router when the old one is not reachable
1006 * or when the new one has a really higher preference value.
1059 defrtrlist_update(struct nd_defrouter *new)
1066 if (new->rtlifetime == 0) {
1067 defrouter_remove(&new->rtaddr, new->ifp);
1074 dr = defrouter_lookup_locked(&new->rtaddr, new->ifp);
1079 dr->raflags = new->raflags; /* XXX flag check */
1080 dr->rtlifetime = new->rtlifetime;
1081 dr->expire = new->expire;
1088 if (dr->installed && rtpref(new) == oldpref) {
1127 memcpy(n, new, sizeof(*n));
1133 * Insert the new router in the Default Router List;
1151 defrouter_select_fib(new->ifp->if_fib);
1172 in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
1282 * If we are going to create a new address upon receiving a multicasted
1358 struct nd_prefix *new;
1362 new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO);
1363 if (new == NULL)
1365 refcount_init(&new->ndpr_refcnt, newp != NULL ? 2 : 1);
1366 new->ndpr_ifp = pr->ndpr_ifp;
1367 new->ndpr_prefix = pr->ndpr_prefix;
1368 new->ndpr_plen = pr->ndpr_plen;
1369 new->ndpr_vltime = pr->ndpr_vltime;
1370 new->ndpr_pltime = pr->ndpr_pltime;
1371 new->ndpr_flags = pr->ndpr_flags;
1372 if ((error = in6_init_prefix_ltimes(new)) != 0) {
1373 free(new, M_IP6NDP);
1376 new->ndpr_lastupdate = time_uptime;
1379 LIST_INIT(&new->ndpr_advrtrs);
1380 in6_prefixlen2mask(&new->ndpr_mask, new->ndpr_plen);
1382 IN6_MASK_ADDR(&new->ndpr_prefix.sin6_addr, &new->ndpr_mask);
1385 LIST_INSERT_HEAD(&V_nd_prefix, new, ndpr_entry);
1390 if (new->ndpr_raf_onlink) {
1395 if ((error = nd6_prefix_onlink(new)) != 0) {
1407 pfxrtr_add(new, dr);
1409 *newp = new;
1475 prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
1480 struct ifnet *ifp = new->ndpr_ifp;
1501 if ((pr = nd6_prefix_lookup(new)) != NULL) {
1503 * nd6_prefix_lookup() ensures that pr and new have the same
1512 if (new->ndpr_raf_onlink == 1)
1514 if (new->ndpr_raf_auto == 1)
1516 if (new->ndpr_raf_onlink) {
1517 pr->ndpr_vltime = new->ndpr_vltime;
1518 pr->ndpr_pltime = new->ndpr_pltime;
1523 if (new->ndpr_raf_onlink &&
1542 if (new->ndpr_vltime == 0)
1544 if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0)
1547 error = nd6_prelist_add(new, dr, &pr);
1551 ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr),
1552 new->ndpr_plen, if_name(new->ndpr_ifp), error));
1576 if (!new->ndpr_raf_auto)
1585 if (new->ndpr_pltime > new->ndpr_vltime) {
1663 if (TWOHOUR < new->ndpr_vltime ||
1664 remaininglifetime < new->ndpr_vltime) {
1665 lt6_tmp.ia6t_vltime = new->ndpr_vltime;
1668 lt6_tmp.ia6t_vltime = new->ndpr_vltime;
1672 * new->ndpr_vltime <= TWOHOUR &&
1679 lt6_tmp.ia6t_pltime = new->ndpr_pltime;
1722 if (ia6_match == NULL && new->ndpr_vltime) {
1728 * Create a new address.
1753 if ((ia6 = in6_ifadd(new, mcast)) != NULL) {
1755 * note that we should use pr (not new) for reference.
1762 * When a new public address is created as described
1763 * in RFC2462, also create a new temporary address.
1766 * When an interface connects to a new link, a new
1768 * immediately together with a new set of temporary
1886 * to a new link where we have a router that does not provide
2362 * XXX: when the temporary address is generated with a new public
2364 * to do the check explicitly everywhere a new address is generated,
2365 * and, in fact, we surely need the check when we create a new