Lines Matching refs:ill

77 #define	ILL_PROBE_INTERVAL(ill)	((ill)->ill_note_link ? 150 : 1500)
114 static int nce_set_multicast_v6(ill_t *ill, const in6_addr_t *addr,
116 static int nce_set_multicast_v4(ill_t *ill, const in_addr_t *dst,
118 static boolean_t ndp_xmit(ill_t *ill, uint32_t operation,
221 nce_add_v6(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len,
227 ASSERT(MUTEX_HELD(&ill->ill_ipst->ips_ndp6->ndp_g_lock));
228 ASSERT(ill != NULL && ill->ill_isv6);
230 err = nce_add_common(ill, hw_addr, hw_addr_len, addr, flags, state,
251 ill_t *ill = ncec->ncec_ill;
254 ip_stack_t *ipst = ill->ill_ipst;
264 (hw_addr == NULL && ill->ill_net_type != IRE_IF_NORESOLVER))
274 if (IS_IPMP(ill)) {
275 hwaddr_ill = ipmp_illgrp_find_ill(ill->ill_grp,
278 hwaddr_ill = ill;
292 dropped = ndp_xmit(ill,
318 * are always added pointing at the ipmp_ill. Thus, when the ill passed
319 * to nce_add_v6 is an under_ill (i.e., IS_UNDER_IPMP(ill)) two nce_t
323 * Local addresses are always created on the ill passed to nce_add_v6.
326 nce_lookup_then_add_v6(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len,
330 ip_stack_t *ipst = ill->ill_ipst;
332 ill_t *in_ill = ill;
341 ASSERT(!IS_IPMP(ill));
342 err = nce_set_multicast_v6(ill, addr, flags, newnce);
345 ASSERT(ill->ill_isv6);
346 if (IS_UNDER_IPMP(ill) && !(flags & NCE_F_MYADDR)) {
347 ill = ipmp_ill_hold_ipmp_ill(ill);
348 if (ill == NULL)
354 nce = nce_lookup_addr(ill, addr);
356 err = nce_add_v6(ill, hw_addr, hw_addr_len, addr, flags, state,
364 if (in_ill != ill && nce != NULL) {
373 if (!IS_IN_SAME_ILLGRP(in_ill, ill)) {
375 ill_t *, ill);
407 ill_refrele(ill);
538 ill_t *ill = ncec->ncec_ill;
573 mutex_enter(&ill->ill_lock);
574 DTRACE_PROBE3(ill__decr__cnt, (ill_t *), ill,
576 ill->ill_ncec_cnt--;
579 * If the number of ncec's associated with this ill have dropped
583 if (ILL_DOWN_OK(ill)) {
585 ipif_ill_refrele_tail(ill);
587 mutex_exit(&ill->ill_lock);
595 * ncec_walk routine. Delete the ncec if it is associated with the ill
652 ill_t *ill, *hwaddr_ill;
656 ill = ncec->ncec_ill;
670 if (IS_IPMP(ill)) {
671 hwaddr_ill = ipmp_illgrp_find_ill(ill->ill_grp,
674 hwaddr_ill = ill;
690 ncec_lookup_illgrp_v6(ill_t *ill, const in6_addr_t *addr)
693 ip_stack_t *ipst = ill->ill_ipst;
700 ncec = ncec_lookup_illgrp(ill, addr, ncec);
710 ncec_lookup_illgrp_v4(ill_t *ill, const in_addr_t *addr)
714 ip_stack_t *ipst = ill->ill_ipst;
722 ncec = ncec_lookup_illgrp(ill, &addr6, ncec);
739 ncec_lookup_illgrp(ill_t *ill, const in6_addr_t *addr, ncec_t *ncec)
742 ip_stack_t *ipst = ill->ill_ipst;
744 if (ill->ill_isv6)
749 ASSERT(ill != NULL);
754 if (ncec->ncec_ill == ill ||
755 IS_IN_SAME_ILLGRP(ill, ncec->ncec_ill)) {
771 * Find an nce_t on ill with nce_addr == addr. Lookup the nce_t
772 * entries for ill only, i.e., when ill is part of an ipmp group,
776 nce_lookup_v4(ill_t *ill, const in_addr_t *addr)
780 ip_stack_t *ipst = ill->ill_ipst;
784 nce = nce_lookup_addr(ill, &addr6);
790 * Find an nce_t on ill with nce_addr == addr. Lookup the nce_t
791 * entries for ill only, i.e., when ill is part of an ipmp group,
795 nce_lookup_v6(ill_t *ill, const in6_addr_t *addr6)
798 ip_stack_t *ipst = ill->ill_ipst;
801 nce = nce_lookup_addr(ill, addr6);
807 nce_lookup_addr(ill_t *ill, const in6_addr_t *addr)
811 ASSERT(ill != NULL);
813 if (ill->ill_isv6)
814 ASSERT(MUTEX_HELD(&ill->ill_ipst->ips_ndp6->ndp_g_lock));
816 ASSERT(MUTEX_HELD(&ill->ill_ipst->ips_ndp4->ndp_g_lock));
818 mutex_enter(&ill->ill_lock);
819 nce = nce_lookup(ill, addr);
820 mutex_exit(&ill->ill_lock);
862 ill_t *ill = ncec->ncec_ill;
863 uint32_t hw_addr_len = ill->ill_phys_addr_length;
942 ncec_walk_common(ndp_g_t *ndp, ill_t *ill, pfi_t pfi, void *arg1,
958 if (ill == NULL || ncec->ncec_ill == ill) {
994 * Note that ill can be NULL hence can't derive the ipst from it.
997 ncec_walk(ill_t *ill, pfi_t pfi, void *arg1, ip_stack_t *ipst)
999 ncec_walk_common(ipst->ips_ndp4, ill, pfi, arg1, B_TRUE);
1000 ncec_walk_common(ipst->ips_ndp6, ill, pfi, arg1, B_TRUE);
1009 nce_set_multicast_v6(ill_t *ill, const in6_addr_t *dst,
1014 ip_stack_t *ipst = ill->ill_ipst;
1017 ASSERT(ill != NULL);
1018 ASSERT(ill->ill_isv6);
1022 nce = nce_lookup_addr(ill, dst);
1027 if (ill->ill_net_type == IRE_IF_RESOLVER) {
1032 hw_addr = kmem_alloc(ill->ill_nd_lla_len, KM_NOSLEEP);
1037 ip_mcast_mapping(ill, (uchar_t *)dst, hw_addr);
1045 err = nce_add_v6(ill, hw_addr, ill->ill_phys_addr_length, dst, flags,
1051 kmem_free(hw_addr, ill->ill_nd_lla_len);
1069 ndp_query(ill_t *ill, struct lif_nd_req *lnr)
1075 ASSERT(ill != NULL && ill->ill_isv6);
1080 * NOTE: if the ill is an IPMP interface, then match against the whole
1085 ncec = ncec_lookup_illgrp_v6(ill, addr);
1093 lnr->lnr_hdw_len = ill->ill_phys_addr_length;
1110 ndp_mcastreq(ill_t *ill, const in6_addr_t *v6group, uint32_t hw_addr_len,
1117 ASSERT(ill->ill_net_type == IRE_IF_RESOLVER);
1122 ASSERT(!(ill->ill_isv6));
1127 ASSERT(ill->ill_isv6);
1138 ip_mcast_mapping(ill, addr, hw_addr);
1194 ndp_solicit(ncec_t *ncec, in6_addr_t src, ill_t *ill)
1208 dropped = ndp_xmit(ill, ND_NEIGHBOR_SOLICIT, ill->ill_phys_addr,
1209 ill->ill_phys_addr_length, &src, &dst, 0);
1230 ill_t *ill = rq->q_ptr;
1236 for (ipif = ill->ill_ipif; ipif != NULL; ipif = ipif->ipif_next) {
1241 if (ill->ill_isv6) {
1255 mutex_enter(&ill->ill_lock);
1258 mutex_exit(&ill->ill_lock);
1263 ill->ill_ipif_dup_count--;
1264 mutex_exit(&ill->ill_lock);
1267 if (ill->ill_isv6) {
1322 ill_t *ill = ipif->ipif_ill;
1324 ip_stack_t *ipst = ill->ill_ipst;
1333 mutex_enter(&ill->ill_lock);
1340 mutex_exit(&ill->ill_lock);
1357 ill_refhold(ill);
1358 qwriter_ip(ill, ill->ill_rq, mp, ip_addr_recover, NEW_OP,
1367 ip_ndp_find_addresses(mblk_t *mp, ip_recv_attr_t *ira, ill_t *ill,
1379 alen = ill->ill_phys_addr_length;
1400 ill_t *ill = rq->q_ptr;
1404 ip_stack_t *ipst = ill->ill_ipst;
1413 /* The ill or ip_stack_t disappeared on us */
1414 BUMP_MIB(ill->ill_ip_mib, ipIfStatsInDiscards);
1415 ip_drop_input("ip_recv_attr_from_mblk", mp, ill);
1421 ASSERT(ill == iras.ira_rill);
1423 ip_ndp_find_addresses(mp, &iras, ill, &targ, &haddr, &haddrlen);
1424 if (haddr != NULL && haddrlen == ill->ill_phys_addr_length) {
1428 * see reflections across any ill in the illgrp.
1440 if (bcmp(haddr, ill->ill_phys_addr, haddrlen) == 0 ||
1441 IS_UNDER_IPMP(ill) &&
1442 ipmp_illgrp_find_ill(ill->ill_grp, haddr,
1453 ipif = ipif_lookup_addr_v6(&targ, ill, ALL_ZONES, ipst);
1457 /* Reload the ill to match the ipif */
1458 ill = ipif->ipif_ill;
1481 mutex_enter(&ill->ill_lock);
1484 ill->ill_ipif_dup_count++;
1485 mutex_exit(&ill->ill_lock);
1488 mutex_enter(&ill->ill_lock);
1490 ill->ill_net_type == IRE_IF_RESOLVER &&
1497 mutex_exit(&ill->ill_lock);
1516 ill_t *ill = ira->ira_rill;
1527 bcmp(haddr, ill->ill_phys_addr, ill->ill_phys_addr_length) == 0) {
1536 BUMP_MIB(ill->ill_ip_mib, ipIfStatsInDiscards);
1537 ip_drop_input("ipIfStatsInDiscards", mp, ill);
1543 ill_refhold(ill);
1544 qwriter_ip(ill, ill->ill_rq, mp, ip_ndp_excl, NEW_OP,
1564 ill_t *ill = ira->ira_ill;
1565 ip_stack_t *ipst = ill->ill_ipst;
1567 boolean_t isv6 = ill->ill_isv6;
1571 ipif = ipif_lookup_addr_v6(&ncec->ncec_addr, ill, ALL_ZONES,
1582 ipif = ipif_lookup_addr(ncec_addr, ill, ALL_ZONES,
1638 ill_t *ill = ira->ira_ill, *under_ill;
1640 uint32_t hlen = ill->ill_phys_addr_length;
1651 mib2_ipv6IfIcmpEntry_t *mib = ill->ill_icmp6_mib;
1696 * NOTE: with IPMP, it's possible the nominated multicast ill (which
1697 * received this packet if it's multicast) is not the ill tied to
1698 * e.g. the IPMP ill's data link-local. So we match across the illgrp
1701 our_ncec = ncec_lookup_illgrp_v6(ill, &target);
1708 "ifname=%s ", ill->ill_name));
1745 ASSERT(ill->ill_isv6);
1775 under_ill = ill;
1777 ill = ipmp_ill_hold_ipmp_ill(under_ill);
1778 if (ill == NULL)
1779 ill = under_ill;
1783 err = nce_lookup_then_add_v6(ill,
1791 ill_refrele(ill);
1792 ill = under_ill;
1847 (void) ndp_xmit(ill,
1867 ill_t *ill = ira->ira_ill;
1869 uint32_t hlen = ill->ill_phys_addr_length;
1877 ip_stack_t *ipst = ill->ill_ipst;
1878 mib2_ipv6IfIcmpEntry_t *mib = ill->ill_icmp6_mib;
1931 if ((dst_ncec = ncec_lookup_illgrp_v6(ill, &target)) == NULL)
1953 * from another ill in the group. Use the double-
1957 if (IS_UNDER_IPMP(ill)) {
1959 if (IS_UNDER_IPMP(ill) && ipmp_illgrp_find_ill(
1960 ill->ill_grp, haddr, hlen) != NULL) {
1986 sizeof (hbuf)), ill->ill_name);
2021 ill_t *ill = ira->ira_rill;
2025 mib2_ipv6IfIcmpEntry_t *mib = ill->ill_icmp6_mib;
2031 * addressed to a unicast address on a different ill.
2033 if (IS_UNDER_IPMP(ill)) {
2034 orig_ill = ill;
2035 ill = ipmp_ill_hold_ipmp_ill(orig_ill);
2036 if (ill == NULL) {
2037 ill = orig_ill;
2038 BUMP_MIB(ill->ill_ip_mib, ipIfStatsInDiscards);
2039 ip_drop_input("ipIfStatsInDiscards - IPMP ill",
2040 mp, ill);
2044 ASSERT(ill != orig_ill);
2046 ira->ira_ill = ill;
2047 mib = ill->ill_icmp6_mib;
2051 BUMP_MIB(ill->ill_ip_mib, ipIfStatsInDiscards);
2052 ip_drop_input("ipIfStatsInDiscards - pullupmsg", mp, ill);
2058 ip_drop_input("ipv6IfIcmpBadHoplimit", mp, ill);
2072 ip_drop_input("Wrong next header", mp, ill);
2081 ip_drop_input("code non-zero", mp, ill);
2092 ip_drop_input("packet too short", mp, ill);
2104 ill_refrele(ill);
2120 * corresponding ill's ill_wq otherwise returns B_TRUE.
2123 ndp_xmit(ill_t *ill, uint32_t operation, uint8_t *hw_addr, uint_t hw_addr_len,
2133 ill_t *hwaddr_ill = ill;
2135 ip_stack_t *ipst = ill->ill_ipst;
2139 if (IS_UNDER_IPMP(ill)) {
2140 probe = ipif_lookup_testaddr_v6(ill, sender, NULL);
2147 * to send the ND packet on the ill corresponding to the src
2151 ill = ipmp_ill_hold_ipmp_ill(ill);
2152 if (ill != NULL)
2155 ill = hwaddr_ill;
2178 zoneid = ipif_lookup_addr_zoneid_v6(sender, ill, ipst);
2194 ill_refrele(ill);
2204 ixas.ixa_ifindex = ill->ill_phyint->phyint_ifindex;
2288 ill_refrele(ill);
2317 ill_t *ill = ncec->ncec_ill, *src_ill;
2342 ip1dbg(("no src ill for %s\n", inet_ntop(AF_INET,
2345 ip1dbg(("no src ill for %s\n", inet_ntop(AF_INET6,
2348 nce_restart_timer(ncec, ill->ill_reachable_retrans_time);
2385 nce_restart_timer(ncec, ill->ill_reachable_retrans_time);
2436 ill->ill_reachable_retrans_time);
2467 ill->ill_reachable_retrans_time);
2468 } else if (ill->ill_phyint->phyint_flags & PHYI_RUNNING) {
2482 &ncec->ncec_addr, ill, ipst);
2486 ipif = ipif_lookup_addr_exact(ncec_addr, ill,
2535 * the ill is down. Wait until it comes back before
2558 if (IS_UNDER_IPMP(ill) && ncec->ncec_nprobes > 0) {
2589 rate_limit = ill_defend_rate_limit(ill, ncec);
2630 * Copy SAP from ill.
2635 ill_t *ill = ncec->ncec_ill;
2638 if (ill->ill_phys_addr_length > 0) {
2656 bcopy(ll_addr, ncec->ncec_lladdr, ill->ill_nd_lla_len);
2679 ill_t *ill = ncec->ncec_ill;
2723 ill->ill_phys_addr_length);
2734 * For IPMP interfaces, all underlying ill's must be checked
2790 * packet is not tied to ncec_ill. If the ill bound to the source address
2822 ill_t *ill = ncec->ncec_ill;
2829 * the actual ill on which the packet was received), but this
2833 iras.ira_ill = iras.ira_rill = ill;
2834 iras.ira_ruifindex = ill->ill_phyint->phyint_ifindex;
2848 BUMP_MIB(ill->ill_ip_mib, ipIfStatsOutDiscards);
2850 mp, ill);
2869 ill_t *ill = ncec->ncec_ill;
2871 ip_stack_t *ipst = ill->ill_ipst;
2888 if (ill->ill_isv6) {
2906 mutex_enter(&ill->ill_lock);
2907 nce = nce_lookup(ill, &ncec->ncec_addr);
2908 mutex_exit(&ill->ill_lock);
2944 ndp_sioc_update(ill_t *ill, lif_nd_req_t *lnr)
2954 ip_stack_t *ipst = ill->ill_ipst;
2957 ASSERT(ill->ill_isv6);
2966 ASSERT(!IS_UNDER_IPMP(ill));
2967 nce = nce_lookup_addr(ill, addr);
3002 err = nce_add_v6(ill,
3004 ill->ill_phys_addr_length,
3052 * Create an nce_t structure for ill using the ncec->ncec_lladdr to set up
3053 * the nce_dlur_mp. If ill != ncec->ncec_ill, then the ips_ill_g_lock must
3057 nce_fastpath_create(ill_t *ill, ncec_t *ncec)
3062 nce = nce_ill_lookup_then_add(ill, ncec);
3077 NCE_LL_ADDR_OFFSET(ill), ill->ill_phys_addr_length);
3079 nce->nce_dlur_mp = ill_dlur_gen(NULL, 0, ill->ill_sap,
3080 ill->ill_sap_length);
3103 ill_t *ill = ncec->ncec_ill;
3105 ASSERT(ill != NULL);
3107 if (IS_IPMP(ill) && trigger_fp_req) {
3113 * If the caller already has the nce corresponding to the ill, use
3119 nce = nce_fastpath_create(ill, ncec);
3138 ill_t *ill = nce->nce_ill;
3141 res = ill_fastpath_probe(ill, nce->nce_dlur_mp);
3150 nce_fastpath_list_delete(ill, ncec, NULL);
3154 * Add ncec to the nce fastpath list on ill.
3157 nce_ill_lookup_then_add_locked(ill_t *ill, ncec_t *ncec)
3161 ASSERT(MUTEX_HELD(&ill->ill_lock));
3163 * Atomically ensure that the ill is not CONDEMNED and is not going
3166 if (ill->ill_state_flags & ILL_CONDEMNED)
3174 nce = nce_lookup(ill, &ncec->ncec_addr);
3177 nce = nce_add(ill, ncec);
3185 nce_ill_lookup_then_add(ill_t *ill, ncec_t *ncec)
3189 mutex_enter(&ill->ill_lock);
3190 nce = nce_ill_lookup_then_add_locked(ill, ncec);
3191 mutex_exit(&ill->ill_lock);
3202 nce_fastpath_list_delete(ill_t *ill, ncec_t *ncec, list_t *dead)
3206 ASSERT(ill != NULL);
3209 if (IS_IPMP(ill))
3212 /* now the ill itself */
3213 mutex_enter(&ill->ill_lock);
3214 for (nce = list_head(&ill->ill_nce); nce != NULL;
3215 nce = list_next(&ill->ill_nce, nce)) {
3222 mutex_exit(&ill->ill_lock);
3240 ill_t *ill = nce->nce_ill;
3243 ip0dbg(("nce_delete_then_add nce %p ill %s\n",
3244 (void *)nce, ill->ill_name));
3245 mutex_enter(&ill->ill_lock);
3254 newnce = nce_add(ill, nce->nce_common);
3256 mutex_exit(&ill->ill_lock);
3268 nce_fastpath_match_dlur(ill_t *ill, nce_t *nce, void *arg)
3318 nce_fastpath_update(ill_t *ill, mblk_t *mp)
3327 nce_walk(ill, nce_fastpath_match_dlur, &nce_fp_marg);
3518 ill_t *ill = ncec->ncec_ill;
3526 * the actual ill on which the packet was received), but this
3530 iras.ira_ill = iras.ira_rill = ill;
3531 iras.ira_ruifindex = ill->ill_phyint->phyint_ifindex;
3546 BUMP_MIB(ill->ill_ip_mib, ipIfStatsOutDiscards);
3548 mp, ill);
3563 * if ill is an under_ill, translate it to the ipmp_ill and add the
3569 nce_lookup_then_add_v4(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len,
3574 ip_stack_t *ipst = ill->ill_ipst;
3576 ill_t *in_ill = ill, *under = NULL;
3585 ASSERT(!IS_IPMP(ill));
3586 err = nce_set_multicast_v4(ill, addr, flags, newnce);
3590 if (IS_UNDER_IPMP(ill) && !(flags & NCE_F_MYADDR)) {
3591 ill = ipmp_ill_hold_ipmp_ill(ill);
3592 if (ill == NULL)
3600 if (IS_IPMP(ill)) {
3601 under = ipmp_ill_hold_xmit_ill(ill, B_FALSE);
3604 ill_refrele(ill);
3611 hw_addr = ill->ill_bcast_mp->b_rptr +
3612 NCE_LL_ADDR_OFFSET(ill),
3613 hw_addr_len = ill->ill_phys_addr_length;
3619 nce = nce_lookup_addr(ill, &addr6);
3621 err = nce_add_v4(ill, hw_addr, hw_addr_len, addr, flags,
3630 if (in_ill != ill && nce != NULL) {
3639 if (!IS_IN_SAME_ILLGRP(in_ill, ill)) {
3641 ill_t *, ill);
3674 ill_refrele(ill);
3685 * are always added pointing at the ipmp_ill. Thus, when the ill passed
3686 * to nce_add_v4 is an under_ill (i.e., IS_UNDER_IPMP(ill)) two nce_t
3690 * Local addresses are always created on the ill passed to nce_add_v4.
3693 nce_add_v4(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len,
3701 ASSERT(MUTEX_HELD(&ill->ill_ipst->ips_ndp4->ndp_g_lock));
3702 ASSERT(!ill->ill_isv6);
3706 err = nce_add_common(ill, hw_addr, hw_addr_len, &addr6, flags, state,
3928 nce_set_multicast_v4(ill_t *ill, const in_addr_t *dst,
3933 ip_stack_t *ipst = ill->ill_ipst;
3937 ASSERT(!ill->ill_isv6);
3941 if ((nce = nce_lookup_addr(ill, &dst6)) != NULL) {
3945 if (ill->ill_net_type == IRE_IF_RESOLVER) {
3949 * in the ill is copied in nce_add_v4().
3951 hw_addr = kmem_alloc(ill->ill_phys_addr_length, KM_NOSLEEP);
3956 ip_mcast_mapping(ill, (uchar_t *)dst, hw_addr);
3967 err = nce_add_v4(ill, hw_addr, ill->ill_phys_addr_length, dst, flags,
3973 kmem_free(hw_addr, ill->ill_phys_addr_length);
4004 ncec_reschedule(ill_t *ill, nce_t *nce, void *arg)
4046 nce_ill_reschedule(ill_t *ill, nce_resched_t *ncert)
4049 ip_stack_t *ipst = ill->ill_ipst;
4052 i = ill->ill_defend_count;
4053 ill->ill_defend_count = 0;
4054 if (ill->ill_isv6)
4060 DTRACE_PROBE1(reschedule_none, ill_t *, ill);
4063 ncert->ncert_ill = ill;
4064 while (ill->ill_defend_count < defend_rate) {
4065 nce_walk_common(ill, ncec_reschedule, ncert);
4076 if (++ill->ill_defend_count >= defend_rate)
4093 ill_defend_rate_limit(ill_t *ill, ncec_t *ncec)
4096 ip_stack_t *ipst = ill->ill_ipst;
4097 clock_t start = ill->ill_defend_start;
4103 if (ill->ill_isv6) {
4113 mutex_enter(&ill->ill_lock);
4117 ill->ill_defend_start = now;
4124 nce_ill_reschedule(ill, &ncert);
4127 ill->ill_defend_start = now;
4129 ASSERT(ill->ill_defend_count <= defend_rate);
4144 if (ill->ill_defend_count < defend_rate)
4145 ill->ill_defend_count++;
4146 if (ill->ill_defend_count == defend_rate) {
4156 mutex_exit(&ill->ill_lock);
4188 ill_t *ill = ncec->ncec_ill;
4234 ipif = ipif_lookup_addr_nondup_v6(&src6, ill, ALL_ZONES,
4235 ill->ill_ipst);
4237 ipif = ipif_lookup_addr_nondup(src4, ill, ALL_ZONES,
4238 ill->ill_ipst);
4271 ipif = ipif_select_source_v6(ill, &ncec->ncec_addr,
4278 ipif = ipif_select_source_v4(ill, nce_addr, ALL_ZONES,
4281 if (ipif == NULL && IS_IPMP(ill)) {
4282 ill_t *send_ill = ipmp_ill_hold_xmit_ill(ill, B_TRUE);
4329 ill_t *ill;
4334 ill = (ipif ? ipif->ipif_ill : NULL);
4335 if (ill != NULL) {
4339 nce = nce_lookup_v4(ill, addr);
4355 * ill is wildcard; clean up all ncec's and ire's
4372 * we always add the ncec with ncec_ill == ill, and always create
4382 nce_add_common(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len,
4390 ip_stack_t *ipst = ill->ill_ipst;
4397 if (ill->ill_isv6)
4398 ndp = ill->ill_ipst->ips_ndp6;
4400 ndp = ill->ill_ipst->ips_ndp4;
4415 if (ill->ill_isv6) {
4425 * The caller has ensured that there is no nce on ill, but there could
4437 if (ncec->ncec_ill == ill) {
4455 *retnce = nce_ill_lookup_then_add(ill, ncec);
4468 ncec->ncec_ill = ill;
4469 ncec->ncec_ipversion = (ill->ill_isv6 ? IPV6_VERSION : IPV4_VERSION);
4473 if (!ill->ill_isv6) {
4485 if (ill->ill_note_link && !IS_IPV4_LL_SPACE(&addr4)) {
4487 } else if (IS_IPMP(ill) && NCE_PUBLISH(ncec) &&
4491 hwaddr_ill = ipmp_illgrp_find_ill(ill->ill_grp, hw_addr,
4523 ncec->ncec_rcnt = ill->ill_xmit_count;
4546 } else if (ill->ill_net_type == IRE_IF_RESOLVER) {
4548 } else if (ill->ill_net_type == IRE_IF_NORESOLVER) {
4554 if (ill->ill_phys_addr_length == IP_ADDR_LEN &&
4555 ill->ill_mactype != DL_IPV4 &&
4556 ill->ill_mactype != DL_6TO4) {
4565 ncec->ncec_lladdr, ill->ill_phys_addr_length);
4567 if (ill->ill_phys_addr_length == IPV6_ADDR_LEN &&
4568 ill->ill_mactype != DL_IPV6) {
4577 ncec->ncec_lladdr, ill->ill_phys_addr_length);
4584 if (!ill->ill_isv6)
4586 } else if (ill->ill_net_type == IRE_LOOPBACK) {
4590 if (hw_addr != NULL || ill->ill_net_type == IRE_IF_NORESOLVER) {
4601 ill->ill_net_type == IRE_IF_NORESOLVER)
4639 ill->ill_net_type == IRE_IF_NORESOLVER) {
4641 ill->ill_phys_addr_length, ill->ill_sap,
4642 ill->ill_sap_length);
4650 * Atomically ensure that the ill is not CONDEMNED, before
4653 mutex_enter(&ill->ill_lock);
4654 if (ill->ill_state_flags & ILL_CONDEMNED) {
4655 mutex_exit(&ill->ill_lock);
4660 (ill->ill_state_flags & ILL_DOWN_IN_PROGRESS)) {
4661 mutex_exit(&ill->ill_lock);
4677 /* Bump up the number of ncec's referencing this ill */
4678 DTRACE_PROBE3(ill__incr__cnt, (ill_t *), ill,
4680 ill->ill_ncec_cnt++;
4685 *retnce = nce_add_impl(ill, ncec, nce, dlur_mp);
4687 mutex_exit(&ill->ill_lock);
4699 kmem_free(template, ill->ill_phys_addr_length);
4741 ill_t *ill = nce->nce_ill;
4750 mutex_enter(&ill->ill_lock);
4751 DTRACE_PROBE3(ill__decr__cnt, (ill_t *), ill,
4753 ill->ill_nce_cnt--;
4756 * If the number of ncec's associated with this ill have dropped
4760 if (ILL_DOWN_OK(ill)) {
4762 ipif_ill_refrele_tail(ill);
4764 mutex_exit(&ill->ill_lock);
4775 nce_add_impl(ill_t *ill, ncec_t *ncec, nce_t *nce, mblk_t *dlur_mp)
4781 nce->nce_ill = ill;
4782 DTRACE_PROBE3(ill__incr__cnt, (ill_t *), ill,
4784 ill->ill_nce_cnt++;
4790 /* add nce to the ill's fastpath list. */
4792 list_insert_head(&ill->ill_nce, nce);
4797 nce_add(ill_t *ill, ncec_t *ncec)
4802 ASSERT(MUTEX_HELD(&ill->ill_lock));
4809 ill->ill_net_type == IRE_IF_NORESOLVER) {
4811 ill->ill_phys_addr_length, ill->ill_sap,
4812 ill->ill_sap_length);
4818 return (nce_add_impl(ill, ncec, nce, dlur_mp));
4827 ill_t *ill = nce->nce_ill;
4829 ASSERT(MUTEX_HELD(&ill->ill_lock));
4842 list_remove(&ill->ill_nce, nce);
4854 nce_lookup(ill_t *ill, const in6_addr_t *addr)
4858 ASSERT(ill != NULL);
4859 ASSERT(MUTEX_HELD(&ill->ill_lock));
4861 for (nce = list_head(&ill->ill_nce); nce != NULL;
4862 nce = list_next(&ill->ill_nce, nce)) {
4879 * Walk the ill_nce list on ill. The callback function func() cannot perform
4883 nce_walk_common(ill_t *ill, pfi_t func, void *arg)
4887 ASSERT(MUTEX_HELD(&ill->ill_lock));
4888 for (nce = list_head(&ill->ill_nce); nce != NULL; ) {
4889 nce_next = list_next(&ill->ill_nce, nce);
4890 if (func(ill, nce, arg) != 0)
4897 nce_walk(ill_t *ill, pfi_t func, void *arg)
4899 mutex_enter(&ill->ill_lock);
4900 nce_walk_common(ill, func, arg);
4901 mutex_exit(&ill->ill_lock);
4905 nce_flush(ill_t *ill, boolean_t flushall)
4911 mutex_enter(&ill->ill_lock);
4912 for (nce = list_head(&ill->ill_nce); nce != NULL; ) {
4913 nce_next = list_next(&ill->ill_nce, nce);
4929 mutex_exit(&ill->ill_lock);
4970 ill_t *ill = ncec->ncec_ill;
4973 ip_stack_t *ipst = ill->ill_ipst;
4977 ASSERT(IS_IPMP(ill));
4996 ill, ALL_ZONES, ipst);
5003 ill, ALL_ZONES, ipst);