Lines Matching defs:ifp

177 	struct ifnet *ifp;
199 ifp = lltable_get_ifp(lle->lle_tbl);
205 dst.sin6_scope_id = in6_getscopezone(ifp,
209 gw.sdl_alen = ifp->if_addrlen;
210 gw.sdl_index = ifp->if_index;
211 gw.sdl_type = ifp->if_type;
213 bcopy(lle->ll_addr, gw.sdl_data, ifp->if_addrlen);
217 fibnum = V_rt_add_addr_allfibs ? RT_ALL_FIBS : ifp->if_fib;
226 nd6_iflladdr(void *arg __unused, struct ifnet *ifp)
228 if (ifp->if_afdata[AF_INET6] == NULL)
231 lltable_update_ifaddr(LLTABLE6(ifp));
281 nd6_ifattach(struct ifnet *ifp)
296 if ((ifp->if_flags & IFF_LOOPBACK) == 0)
304 if ((V_ip6_auto_linklocal && ifp->if_type != IFT_BRIDGE &&
305 ifp->if_type != IFT_WIREGUARD) || (ifp->if_flags & IFF_LOOPBACK))
315 !(ifp->if_flags & IFF_LOOPBACK) &&
316 (ifp->if_type != IFT_BRIDGE)) {
321 if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK))
324 /* XXX: we cannot call nd6_setmtu since ifp is not fully initialized */
325 nd6_setmtu0(ifp, nd);
331 nd6_ifdetach(struct ifnet *ifp, struct nd_ifinfo *nd)
337 CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
354 nd6_setmtu(struct ifnet *ifp)
356 if (ifp->if_afdata[AF_INET6] == NULL)
359 nd6_setmtu0(ifp, ND_IFINFO(ifp));
362 /* XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */
364 nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi)
369 ndi->maxmtu = ifp->if_mtu;
380 if_name(ifp), (unsigned long)ndi->maxmtu);
705 struct ifnet *ifp;
714 ifp = lle->lle_tbl->llt_ifp;
715 delay = (long)ND_IFINFO(ifp)->retrans * hz / 1000;
719 ifp = lle->lle_tbl->llt_ifp;
720 delay = (long)ND_IFINFO(ifp)->reachable * hz;
756 struct ifnet *ifp;
763 ifp = lltable_get_ifp(ln->lle_tbl);
764 CURVNET_SET(ifp->if_vnet);
791 ndi = ND_IFINFO(ifp);
857 ICMP6_DST_UNREACH_ADDR, 0, ifp);
921 nd6_ns_output(ifp, psrc, pdst, dst, NULL);
940 struct ifnet *ifp;
1027 ifp = ia6->ia_ifp;
1028 if ((ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD) == 0 &&
1029 ((ifp->if_flags & IFF_UP) == 0 ||
1030 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
1031 (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) != 0)){
1100 struct ifnet *ifp;
1105 ifp = ia6->ia_ifa.ifa_ifp;
1106 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1164 * Remove prefix and default router list entries corresponding to ifp. Neighbor
1168 nd6_purge(struct ifnet *ifp)
1175 /* Purge default router list entries toward ifp. */
1176 nd6_defrouter_purge(ifp);
1180 * Remove prefixes on ifp. We should have already removed addresses on
1184 if (pr->ndpr_ifp == ifp)
1196 if (V_nd6_defifindex == ifp->if_index)
1199 if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
1201 defrouter_select_fib(ifp->if_fib);
1210 nd6_lookup(const struct in6_addr *addr6, int flags, struct ifnet *ifp)
1220 IF_AFDATA_LOCK_ASSERT(ifp);
1222 ln = lla_lookup(LLTABLE6(ifp), flags, (struct sockaddr *)&sin6);
1228 nd6_alloc(const struct in6_addr *addr6, int flags, struct ifnet *ifp)
1238 ln = lltable_alloc_entry(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6);
1249 nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
1267 if (in6_setscope(&sin6_copy.sin6_addr, ifp, &zone))
1278 nh = fib6_lookup(ifp->if_fib, &addr->sin6_addr, 0, NHR_NONE, 0);
1279 if (nh != NULL && nh->nh_aifp == ifp && (nh->nh_flags & NHF_GATEWAY) == 0)
1290 if (pr->ndpr_ifp != ifp)
1308 if (ifp->if_flags & IFF_POINTOPOINT) {
1311 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1325 if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV &&
1327 V_nd6_defifindex == ifp->if_index) {
1339 nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
1345 IF_AFDATA_UNLOCK_ASSERT(ifp);
1346 if (nd6_is_new_addr_neighbor(addr, ifp))
1353 if ((lle = nd6_lookup(&addr->sin6_addr, LLE_SF(AF_INET6, 0), ifp)) != NULL) {
1382 nd6_try_set_entry_addr_locked(struct ifnet *ifp, struct llentry *lle, char *lladdr)
1389 if (lltable_calc_llheader(ifp, AF_INET6, lladdr, buf, &sz, &off) != 0)
1393 lltable_set_entry_addr(ifp, lle, buf, sz, off);
1400 if (lltable_calc_llheader(ifp, fam, lladdr, buf, &sz, &off) == 0) {
1402 lltable_set_entry_addr(ifp, child_lle, buf, sz, off);
1412 nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr)
1417 if (!lltable_acquire_wlock(ifp, lle))
1419 bool ret = nd6_try_set_entry_addr_locked(ifp, lle, lladdr);
1420 IF_AFDATA_WUNLOCK(ifp);
1436 struct ifnet *ifp;
1448 ifp = lltable_get_ifp(ln->lle_tbl);
1449 if ((ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0)
1450 dr = defrouter_lookup_locked(&ln->r_l3addr.addr6, ifp);
1466 if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
1525 rt6_flush(&ln->r_l3addr.addr6, ifp);
1540 defrouter_select_fib(dr->ifp->if_fib);
1559 IF_AFDATA_LOCK(ifp);
1567 IF_AFDATA_UNLOCK(ifp);
1639 nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
1647 if (ifp->if_afdata[AF_INET6] == NULL)
1654 ND.linkmtu = IN6_LINKMTU(ifp);
1655 ND.maxmtu = ND_IFINFO(ifp)->maxmtu;
1656 ND.basereachable = ND_IFINFO(ifp)->basereachable;
1657 ND.reachable = ND_IFINFO(ifp)->reachable;
1658 ND.retrans = ND_IFINFO(ifp)->retrans;
1659 ND.flags = ND_IFINFO(ifp)->flags;
1660 ND.recalctm = ND_IFINFO(ifp)->recalctm;
1661 ND.chlim = ND_IFINFO(ifp)->chlim;
1664 ND = *ND_IFINFO(ifp);
1674 ND.linkmtu > IN6_LINKMTU(ifp)) {
1678 ND_IFINFO(ifp)->linkmtu = ND.linkmtu;
1682 int obasereachable = ND_IFINFO(ifp)->basereachable;
1684 ND_IFINFO(ifp)->basereachable = ND.basereachable;
1686 ND_IFINFO(ifp)->reachable =
1690 ND_IFINFO(ifp)->retrans = ND.retrans;
1692 ND_IFINFO(ifp)->chlim = ND.chlim;
1699 if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
1710 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1727 ND_IFINFO(ifp)->flags &= ~ND6_IFF_IFDISABLED;
1728 if (ifp->if_flags & IFF_UP)
1729 in6_if_up(ifp);
1731 } else if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
1736 ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED;
1738 (ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD) == 0) {
1740 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead,
1753 if (!(ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL)) {
1756 /* If no link-local address on ifp, configure */
1757 ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL;
1758 in6_ifattach(ifp, NULL);
1760 ifp->if_flags & IFF_UP) {
1768 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead,
1780 in6_ifattach(ifp, NULL);
1783 ND_IFINFO(ifp)->flags = ND.flags;
1837 if ((error = in6_setscope(&nb_addr, ifp, NULL)) != 0)
1841 ln = nd6_lookup(&nb_addr, LLE_SF(AF_INET6, 0), ifp);
1956 nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
1972 IF_AFDATA_UNLOCK_ASSERT(ifp);
1974 KASSERT(ifp != NULL, ("%s: ifp == NULL", __func__));
1982 * Validation about ifp->if_addrlen and lladdrlen must be done in
1986 * we do? (ifp->if_addrlen == 0)
1991 ln = nd6_lookup(from, LLE_SF(AF_INET6, flags), ifp);
1995 ln = nd6_alloc(from, 0, ifp);
2005 if (lltable_calc_llheader(ifp, AF_INET6, lladdr,
2007 lltable_free_entry(LLTABLE6(ifp), ln);
2010 lltable_set_entry_addr(ifp, ln, linkhdr, linkhdrsize,
2014 IF_AFDATA_WLOCK(ifp);
2017 ln_tmp = nd6_lookup(from, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp);
2019 lltable_link_entry(LLTABLE6(ifp), ln);
2020 IF_AFDATA_WUNLOCK(ifp);
2030 lltable_free_entry(LLTABLE6(ifp), ln);
2047 ifp->if_addrlen);
2070 * XXX is it dependent to ifp->if_type?
2072 if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) {
2101 nd6_flush_holdchain(ifp, ln, chain);
2103 nd6_flush_children_holdchain(ifp, ln);
2121 ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
2125 defrouter_select_fib(ifp->if_fib);
2135 struct ifnet *ifp;
2140 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
2141 if (ifp->if_afdata[AF_INET6] == NULL)
2143 nd6if = ND_IFINFO(ifp);
2188 nd6_output_ifp(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
2197 mac_netinet6_nd6_send(ifp, m);
2213 error = send_sendso_input_hook(m, ifp, SND_OUT,
2222 IP_PROBE(send, NULL, NULL, mtod(m, struct ip6_hdr *), ifp, NULL,
2225 if ((ifp->if_flags & IFF_LOOPBACK) == 0)
2226 origifp = ifp;
2228 error = (*ifp->if_output)(origifp, m, (struct sockaddr *)dst, ro);
2246 nd6_resolve(struct ifnet *ifp, int gw_flags, struct mbuf *m,
2261 if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)) {
2267 switch (ifp->if_type) {
2282 ln = nd6_lookup(&dst6->sin6_addr, LLE_SF(family, lookup_flags), ifp);
2298 return (nd6_resolve_slow(ifp, family, 0, m, dst6, desten, pflags, plle));
2314 nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family)
2319 lle = nd6_alloc(addr, 0, ifp);
2321 child_lle = nd6_alloc(addr, 0, ifp);
2323 lltable_free_entry(LLTABLE6(ifp), lle);
2340 IF_AFDATA_WLOCK(ifp);
2343 lle_tmp = nd6_lookup(addr, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp);
2345 lltable_link_entry(LLTABLE6(ifp), lle);
2347 lltable_free_entry(LLTABLE6(ifp), lle);
2359 lltable_free_entry(LLTABLE6(ifp), child_lle);
2365 IF_AFDATA_WUNLOCK(ifp);
2381 nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m,
2398 lle = nd6_lookup(&dst->sin6_addr, LLE_SF(family, LLE_EXCLUSIVE), ifp);
2399 if ((lle == NULL) && nd6_is_addr_neighbor(dst, ifp)) {
2405 lle = nd6_get_llentry(ifp, &dst->sin6_addr, family);
2433 ll_len = ifp->if_addrlen;
2488 nd6_ns_output(ifp, psrc, NULL, &dst->sin6_addr, NULL);
2504 nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst,
2510 error = nd6_resolve_slow(ifp, AF_INET6, flags, NULL,
2516 nd6_flush_holdchain(struct ifnet *ifp, struct llentry *lle, struct mbuf *chain)
2536 error = nd6_output_ifp(ifp, ifp, m, &dst6, (struct route *)&ro);
2547 nd6_flush_children_holdchain(struct ifnet *ifp, struct llentry *lle)
2558 nd6_flush_holdchain(ifp, child_lle, chain);
2563 nd6_need_cache(struct ifnet *ifp)
2572 switch (ifp->if_type) {
2599 struct ifnet *ifp;
2603 ifp = ia->ia_ifa.ifa_ifp;
2604 if (nd6_need_cache(ifp) == 0)
2608 ln = lltable_alloc_entry(LLTABLE6(ifp), LLE_IFADDR, dst);
2612 IF_AFDATA_WLOCK(ifp);
2615 ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_SF(AF_INET6, LLE_EXCLUSIVE), dst);
2617 lltable_unlink_entry(LLTABLE6(ifp), ln_tmp);
2618 lltable_link_entry(LLTABLE6(ifp), ln);
2619 IF_AFDATA_WUNLOCK(ifp);
2641 struct ifnet *ifp;
2643 ifp = ia->ia_ifa.ifa_ifp;
2652 lltable_delete_addr(LLTABLE6(ifp), LLE_IFADDR, saddr);