Lines Matching refs:ifp
323 struct ifnet *ifp;
331 ifp = ifindex2ifnet[idx];
334 ifnet_lock_shared(ifp);
335 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
341 ifnet_lock_done(ifp);
345 ifnet_lock_done(ifp);
406 in6_control(so, cmd, data, ifp, p)
410 struct ifnet *ifp;
436 if (ifp == NULL)
463 return(nd6_ioctl(cmd, data, ifp));
483 return(scope6_set(ifp, ifr->ifr_ifru.ifru_scope_id));
486 return(scope6_get(ifp, ifr->ifr_ifru.ifru_scope_id));
500 return in6_lifaddr_ioctl(so, cmd, data, ifp, p);
508 ifnet_lock_exclusive(ifp);
509 ifp->if_eflags |= IFEF_ACCEPT_RTADVD;
510 ifnet_lock_done(ifp);
517 ifnet_lock_exclusive(ifp);
518 ifp->if_eflags &= ~IFEF_ACCEPT_RTADVD;
519 ifnet_lock_done(ifp);
522 in6_purgeprefix(ifp);
528 if (ia->ia_ifa.ifa_ifp != ifp)
544 if (ifp->if_type == IFT_PPP && ifra->ifra_addr.sin6_family == AF_INET6 &&
546 in6_if_up(ifp, ifra); /* PPP may provide LinkLocal addresses */
548 in6_if_up(ifp, 0);
561 if (ia->ia_ifa.ifa_ifp != ifp)
573 switch (ifp->if_type) {
581 if ((error = proto_plumb(PF_INET6, ifp)))
583 if_name(ifp), error);
592 in6_purgeif(ifp); /* Cleanup interface routes and addresses */
594 if ((error = proto_unplumb(PF_INET6, ifp)))
596 if_name(ifp), error);
612 htons(ifp->if_index);
614 htons(ifp->if_index)) {
619 (u_int32_t)ifp->if_index)
624 ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr);
719 if ((ifp->if_flags & IFF_POINTOPOINT) == 0) {
739 if (ifp == NULL) {
743 index = ifp->if_index;
754 if (ifp == NULL) {
758 index = ifp->if_index;
794 error = proto_plumb(PF_INET6, ifp);
798 if_name(ifp), error);
807 in6_if_up(ifp, NULL);
814 if ((error = in6_update_ifa(ifp, ifra, ia)) != 0)
829 pr0.ndpr_ifp = ifp;
869 if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr))
929 pr0.ndpr_ifp = ifp;
966 error = ifnet_ioctl(ifp, PF_INET6, cmd, data);
980 in6_update_ifa(ifp, ifra, ia)
981 struct ifnet *ifp;
994 if (ifp == NULL || ifra == NULL) /* this maybe redundant */
1001 if ((ifp->if_flags & IFF_POINTOPOINT) != 0 &&
1047 if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) &&
1054 ifp)) != 0)
1057 scopeid = in6_addr2scopeid(ifp, &dst6.sin6_addr);
1075 if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) == 0) {
1135 if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) {
1148 ia->ia_ifp = ifp;
1158 ifnet_lock_exclusive(ifp);
1159 if_attach_ifa(ifp, &ia->ia_ifa);
1160 ifnet_lock_done(ifp);
1206 if ((error = in6_ifinit(ifp, ia, &ifra->ifra_addr, hostIsNew)) != 0)
1228 if ((ifp->if_flags & IFF_MULTICAST) != 0) {
1239 llsol.s6_addr16[1] = htons(ifp->if_index);
1245 (void)in6_addmulti(&llsol, ifp, &error, 0);
1250 ip6_sprintf(&llsol), if_name(ifp),
1269 mltaddr.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
1271 ifnet_lock_shared(ifp);
1272 IN6_LOOKUP_MULTI(mltaddr.sin6_addr, ifp, in6m);
1273 ifnet_lock_done(ifp);
1281 (void)in6_addmulti(&mltaddr.sin6_addr, ifp, &error, 0);
1287 if_name(ifp), error);
1295 if (in6_nigroup(ifp, hostname, hostnamelen, &mltaddr.sin6_addr)
1297 ifnet_lock_shared(ifp);
1298 IN6_LOOKUP_MULTI(mltaddr.sin6_addr, ifp, in6m);
1299 ifnet_lock_done(ifp);
1302 ifp, &error, 0);
1308 if_name(ifp), error);
1320 if (ifp->if_flags & IFF_LOOPBACK) {
1324 ia_loop = in6ifa_ifpwithaddr(ifp, &loop6);
1328 ifnet_lock_shared(ifp);
1329 IN6_LOOKUP_MULTI(mltaddr.sin6_addr, ifp, in6m);
1330 ifnet_lock_done(ifp);
1338 (void)in6_addmulti(&mltaddr.sin6_addr, ifp,
1345 if_name(ifp), error);
1373 nd6_ifattach(ifp);
1380 if (in6if_do_dad(ifp) && (ifra->ifra_flags & IN6_IFF_NODAD) == 0) {
1393 in6_unlink_ifa(ia, ifp, 0);
1401 struct ifnet *ifp = ifa->ifa_ifp;
1419 ip6_sprintf(&ia->ia_addr.sin6_addr), if_name(ifp),
1430 if (ifp->if_flags & IFF_MULTICAST) {
1438 llsol.s6_addr16[1] = htons(ifp->if_index);
1445 ifnet_lock_shared(ifp);
1446 IN6_LOOKUP_MULTI(llsol, ifp, in6m);
1447 ifnet_lock_done(ifp);
1452 in6_unlink_ifa(ia, ifp, nd6_locked);
1453 in6_post_msg(ifp, KEV_INET6_ADDR_DELETED, ia);
1457 in6_unlink_ifa(ia, ifp, nd6_locked)
1459 struct ifnet *ifp;
1465 ifnet_lock_exclusive(ifp);
1466 if_detach_ifa(ifp, &ia->ia_ifa);
1467 ifnet_lock_done(ifp);
1521 in6_purgeif(ifp)
1522 struct ifnet *ifp;
1526 if (ifp == NULL || &ifp->if_addrlist == NULL)
1533 if (ia->ia_ifa.ifa_ifp != ifp)
1539 in6_ifdetach(ifp);
1566 in6_lifaddr_ioctl(so, cmd, data, ifp, p)
1570 struct ifnet *ifp;
1578 if (!data || !ifp) {
1631 ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, 0);
1681 return in6_control(so, SIOCAIFADDR_IN6, (caddr_t)&ifra, ifp, p);
1722 ifnet_lock_shared(ifp);
1723 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
1747 ifnet_lock_done(ifp);
1764 in6_addr2scopeid(ifp, &s6->sin6_addr);
1767 if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
1775 in6_addr2scopeid(ifp,
1799 if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
1811 ifp, p);
1824 in6_ifinit(ifp, ia, sin6, newhost)
1825 struct ifnet *ifp;
1838 ifnet_lock_shared(ifp);
1839 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
1847 ifnet_lock_done(ifp);
1853 (error = ifnet_ioctl(ifp, PF_INET6, SIOCSIFADDR, ia))) {
1859 ia->ia_ifa.ifa_metric = ifp->if_metric;
1898 in6_addmulti(maddr6, ifp, errorp, nd6_locked)
1900 struct ifnet *ifp;
1919 *errorp = if_addmulti(ifp, (struct sockaddr *)&sin6, &ifma);
1940 in6m->in6m_ifp = ifp;
1991 in6ifa_ifpforlinklocal(ifp, ignoreflags)
1992 struct ifnet *ifp;
1997 ifnet_lock_shared(ifp);
1998 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2011 ifnet_lock_done(ifp);
2020 in6ifa_ifpwithaddr(ifp, addr)
2021 struct ifnet *ifp;
2026 ifnet_lock_shared(ifp);
2027 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2036 ifnet_lock_done(ifp);
2253 struct ifnet *ifp;
2269 TAILQ_FOREACH(ifp, &ifnet_head, if_list) {
2274 if (in6_addr2scopeid(ifp, dst) != in6_addr2scopeid(oifp, dst))
2277 ifnet_lock_shared(ifp);
2278 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2460 if (bifp == oifp && ifp != oifp) /* (1) */
2462 if (bifp != oifp && ifp == oifp) /* (2) */
2466 * Both bifp and ifp are on the outgoing
2502 ifnet_lock_done(ifp);
2533 struct ifnet *ifp,
2549 ifnet_lock_shared(ifp);
2550 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2583 ifnet_lock_done(ifp);
2587 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2603 ifnet_lock_done(ifp);
2606 ifnet_lock_done(ifp);
2622 struct ifnet *ifp,
2635 in6_ifattach(ifp, NULL, ifra);
2638 ifnet_lock_exclusive(ifp);
2639 TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
2647 ifnet_lock_done(ifp);
2652 struct ifnet *ifp)
2654 if ((ifp->if_flags & IFF_LOOPBACK) != 0)
2657 switch (ifp->if_type) {
2679 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) !=
2695 struct ifnet *ifp;
2698 TAILQ_FOREACH(ifp, &ifnet_head, if_list) {
2699 if ((ifp->if_flags & IFF_LOOPBACK) == 0 &&
2700 IN6_LINKMTU(ifp) > maxmtu)
2701 maxmtu = IN6_LINKMTU(ifp);
2769 in6_post_msg(struct ifnet *ifp, u_long event_code, struct in6_ifaddr *ifa)
2787 if (ifp != NULL) {
2788 strncpy(&in6_event_data.link_data.if_name[0], ifp->if_name, IFNAMSIZ);
2789 in6_event_data.link_data.if_family = ifp->if_family;
2790 in6_event_data.link_data.if_unit = (unsigned long) ifp->if_unit;