Lines Matching refs:mcip
358 find_dhcpv4_pending_txn(mac_client_impl_t *mcip, uint32_t xid) in find_dhcpv4_pending_txn() argument
362 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in find_dhcpv4_pending_txn()
364 return (avl_find(&mcip->mci_v4_pending_txn, &tmp_txn, NULL)); in find_dhcpv4_pending_txn()
368 insert_dhcpv4_pending_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in insert_dhcpv4_pending_txn() argument
372 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in insert_dhcpv4_pending_txn()
373 if (avl_find(&mcip->mci_v4_pending_txn, txn, &where) != NULL) in insert_dhcpv4_pending_txn()
376 if (avl_numnodes(&mcip->mci_v4_pending_txn) >= dhcp_max_pending_txn) { in insert_dhcpv4_pending_txn()
377 BUMP_STAT(mcip, dhcpdropped); in insert_dhcpv4_pending_txn()
380 avl_insert(&mcip->mci_v4_pending_txn, txn, where); in insert_dhcpv4_pending_txn()
385 remove_dhcpv4_pending_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in remove_dhcpv4_pending_txn() argument
387 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in remove_dhcpv4_pending_txn()
388 avl_remove(&mcip->mci_v4_pending_txn, txn); in remove_dhcpv4_pending_txn()
392 find_dhcpv4_completed_txn(mac_client_impl_t *mcip, uint8_t *cid, in find_dhcpv4_completed_txn() argument
397 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in find_dhcpv4_completed_txn()
401 return (avl_find(&mcip->mci_v4_completed_txn, &tmp_txn, NULL)); in find_dhcpv4_completed_txn()
411 insert_dhcpv4_completed_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in insert_dhcpv4_completed_txn() argument
415 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in insert_dhcpv4_completed_txn()
416 if (avl_find(&mcip->mci_v4_completed_txn, txn, &where) != NULL) in insert_dhcpv4_completed_txn()
419 if (avl_numnodes(&mcip->mci_v4_completed_txn) >= in insert_dhcpv4_completed_txn()
421 BUMP_STAT(mcip, dhcpdropped); in insert_dhcpv4_completed_txn()
425 avl_insert(&mcip->mci_v4_completed_txn, txn, where); in insert_dhcpv4_completed_txn()
426 if (avl_find(&mcip->mci_v4_dyn_ip, txn, &where) != NULL) { in insert_dhcpv4_completed_txn()
427 avl_remove(&mcip->mci_v4_completed_txn, txn); in insert_dhcpv4_completed_txn()
430 avl_insert(&mcip->mci_v4_dyn_ip, txn, where); in insert_dhcpv4_completed_txn()
435 remove_dhcpv4_completed_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in remove_dhcpv4_completed_txn() argument
439 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in remove_dhcpv4_completed_txn()
440 if ((ctxn = avl_find(&mcip->mci_v4_dyn_ip, txn, NULL)) != NULL && in remove_dhcpv4_completed_txn()
442 avl_remove(&mcip->mci_v4_dyn_ip, txn); in remove_dhcpv4_completed_txn()
444 avl_remove(&mcip->mci_v4_completed_txn, txn); in remove_dhcpv4_completed_txn()
451 check_dhcpv4_dyn_ip(mac_client_impl_t *mcip, ipaddr_t ipaddr) in check_dhcpv4_dyn_ip() argument
455 mutex_enter(&mcip->mci_protect_lock); in check_dhcpv4_dyn_ip()
457 txn = avl_find(&mcip->mci_v4_dyn_ip, &tmp_txn, NULL); in check_dhcpv4_dyn_ip()
458 mutex_exit(&mcip->mci_protect_lock); in check_dhcpv4_dyn_ip()
492 flush_dhcpv4(mac_client_impl_t *mcip) in flush_dhcpv4() argument
497 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in flush_dhcpv4()
498 while ((txn = avl_destroy_nodes(&mcip->mci_v4_dyn_ip, in flush_dhcpv4()
506 while ((txn = avl_destroy_nodes(&mcip->mci_v4_completed_txn, in flush_dhcpv4()
511 while ((txn = avl_destroy_nodes(&mcip->mci_v4_pending_txn, in flush_dhcpv4()
521 txn_cleanup_v4(mac_client_impl_t *mcip) in txn_cleanup_v4() argument
529 for (txn = avl_first(&mcip->mci_v4_pending_txn); txn != NULL; in txn_cleanup_v4()
530 txn = avl_walk(&mcip->mci_v4_pending_txn, txn, AVL_AFTER)) { in txn_cleanup_v4()
533 mac_client_impl_t *, mcip, in txn_cleanup_v4()
546 avl_remove(&mcip->mci_v4_pending_txn, txn); in txn_cleanup_v4()
548 ctxn = find_dhcpv4_completed_txn(mcip, txn->dt_cid, in txn_cleanup_v4()
552 mac_client_impl_t *, mcip, in txn_cleanup_v4()
555 remove_dhcpv4_completed_txn(mcip, ctxn); in txn_cleanup_v4()
561 DTRACE_PROBE2(freeing__txn, mac_client_impl_t *, mcip, in txn_cleanup_v4()
571 intercept_dhcpv4_outbound(mac_client_impl_t *mcip, ipha_t *ipha, uchar_t *end) in intercept_dhcpv4_outbound() argument
578 mac_resource_props_t *mrp = MCIP_RESOURCE_PROPS(mcip); in intercept_dhcpv4_outbound()
589 DTRACE_PROBE2(mtype__not__found, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
595 DTRACE_PROBE3(ignored__mtype, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
610 mutex_enter(&mcip->mci_protect_lock); in intercept_dhcpv4_outbound()
612 DTRACE_PROBE2(release, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
616 ctxn = find_dhcpv4_completed_txn(mcip, cid, cid_len); in intercept_dhcpv4_outbound()
619 mcip, struct dhcp *, dh4); in intercept_dhcpv4_outbound()
621 remove_dhcpv4_completed_txn(mcip, ctxn); in intercept_dhcpv4_outbound()
632 if ((txn = find_dhcpv4_pending_txn(mcip, dh4->xid)) != NULL) { in intercept_dhcpv4_outbound()
633 DTRACE_PROBE2(update, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
641 DTRACE_PROBE2(ipaddr__not__found, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
649 if (insert_dhcpv4_pending_txn(mcip, txn) != 0) { in intercept_dhcpv4_outbound()
650 DTRACE_PROBE2(insert__failed, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
655 start_txn_cleanup_timer(mcip); in intercept_dhcpv4_outbound()
657 DTRACE_PROBE2(txn__pending, mac_client_impl_t *, mcip, in intercept_dhcpv4_outbound()
661 mutex_exit(&mcip->mci_protect_lock); in intercept_dhcpv4_outbound()
669 intercept_dhcpv4_inbound(mac_client_impl_t *mcip, uchar_t *end, in intercept_dhcpv4_inbound() argument
678 DTRACE_PROBE2(mtype__not__found, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
684 DTRACE_PROBE3(ignored__mtype, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
689 mutex_enter(&mcip->mci_protect_lock); in intercept_dhcpv4_inbound()
690 if ((txn = find_dhcpv4_pending_txn(mcip, dh4->xid)) == NULL) { in intercept_dhcpv4_inbound()
691 DTRACE_PROBE2(txn__not__found, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
695 remove_dhcpv4_pending_txn(mcip, txn); in intercept_dhcpv4_inbound()
702 ctxn = find_dhcpv4_completed_txn(mcip, txn->dt_cid, txn->dt_cid_len); in intercept_dhcpv4_inbound()
704 DTRACE_PROBE2(replacing__old__txn, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
706 remove_dhcpv4_completed_txn(mcip, ctxn); in intercept_dhcpv4_inbound()
710 DTRACE_PROBE2(nak__received, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
715 if (insert_dhcpv4_completed_txn(mcip, txn) != 0) { in intercept_dhcpv4_inbound()
716 DTRACE_PROBE2(insert__failed, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
721 DTRACE_PROBE2(txn__completed, mac_client_impl_t *, mcip, in intercept_dhcpv4_inbound()
725 mutex_exit(&mcip->mci_protect_lock); in intercept_dhcpv4_inbound()
1083 remove_dhcpv6_cid(mac_client_impl_t *mcip, dhcpv6_cid_t *cid) in remove_dhcpv6_cid() argument
1087 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in remove_dhcpv6_cid()
1088 avl_remove(&mcip->mci_v6_cid, cid); in remove_dhcpv6_cid()
1090 tmp_addr = avl_find(&mcip->mci_v6_dyn_ip, addr, NULL); in remove_dhcpv6_cid()
1092 avl_remove(&mcip->mci_v6_dyn_ip, addr); in remove_dhcpv6_cid()
1101 release_dhcpv6_cid(mac_client_impl_t *mcip, dhcpv6_cid_t *cid) in release_dhcpv6_cid() argument
1105 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in release_dhcpv6_cid()
1106 if ((oldcid = avl_find(&mcip->mci_v6_cid, cid, NULL)) == NULL) in release_dhcpv6_cid()
1114 remove_dhcpv6_cid(mcip, oldcid); in release_dhcpv6_cid()
1122 insert_dhcpv6_cid(mac_client_impl_t *mcip, dhcpv6_cid_t *cid) in insert_dhcpv6_cid() argument
1127 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in insert_dhcpv6_cid()
1128 if (avl_find(&mcip->mci_v6_cid, cid, &where) != NULL) in insert_dhcpv6_cid()
1131 if (avl_numnodes(&mcip->mci_v6_cid) >= dhcp_max_completed_txn) { in insert_dhcpv6_cid()
1132 BUMP_STAT(mcip, dhcpdropped); in insert_dhcpv6_cid()
1135 avl_insert(&mcip->mci_v6_cid, cid, where); in insert_dhcpv6_cid()
1137 if (avl_find(&mcip->mci_v6_dyn_ip, addr, &where) != NULL) in insert_dhcpv6_cid()
1140 avl_insert(&mcip->mci_v6_dyn_ip, addr, where); in insert_dhcpv6_cid()
1145 remove_dhcpv6_cid(mcip, cid); in insert_dhcpv6_cid()
1153 check_dhcpv6_dyn_ip(mac_client_impl_t *mcip, in6_addr_t *addr) in check_dhcpv6_dyn_ip() argument
1157 mutex_enter(&mcip->mci_protect_lock); in check_dhcpv6_dyn_ip()
1159 a = avl_find(&mcip->mci_v6_dyn_ip, &tmp_addr, NULL); in check_dhcpv6_dyn_ip()
1160 mutex_exit(&mcip->mci_protect_lock); in check_dhcpv6_dyn_ip()
1165 find_dhcpv6_pending_txn(mac_client_impl_t *mcip, uint32_t xid) in find_dhcpv6_pending_txn() argument
1169 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in find_dhcpv6_pending_txn()
1171 return (avl_find(&mcip->mci_v6_pending_txn, &tmp_txn, NULL)); in find_dhcpv6_pending_txn()
1175 remove_dhcpv6_pending_txn(mac_client_impl_t *mcip, dhcpv6_txn_t *txn) in remove_dhcpv6_pending_txn() argument
1177 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in remove_dhcpv6_pending_txn()
1178 avl_remove(&mcip->mci_v6_pending_txn, txn); in remove_dhcpv6_pending_txn()
1204 insert_dhcpv6_pending_txn(mac_client_impl_t *mcip, dhcpv6_txn_t *txn) in insert_dhcpv6_pending_txn() argument
1208 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in insert_dhcpv6_pending_txn()
1209 if (avl_find(&mcip->mci_v6_pending_txn, txn, &where) != NULL) in insert_dhcpv6_pending_txn()
1212 if (avl_numnodes(&mcip->mci_v6_pending_txn) >= dhcp_max_pending_txn) { in insert_dhcpv6_pending_txn()
1213 BUMP_STAT(mcip, dhcpdropped); in insert_dhcpv6_pending_txn()
1216 avl_insert(&mcip->mci_v6_pending_txn, txn, where); in insert_dhcpv6_pending_txn()
1224 flush_dhcpv6(mac_client_impl_t *mcip) in flush_dhcpv6() argument
1230 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in flush_dhcpv6()
1231 while (avl_destroy_nodes(&mcip->mci_v6_dyn_ip, &cookie) != NULL) { in flush_dhcpv6()
1234 while ((cid = avl_destroy_nodes(&mcip->mci_v6_cid, &cookie)) != NULL) { in flush_dhcpv6()
1238 while ((txn = avl_destroy_nodes(&mcip->mci_v6_pending_txn, in flush_dhcpv6()
1245 flush_slaac(mac_client_impl_t *mcip) in flush_slaac() argument
1250 while ((addr = avl_destroy_nodes(&mcip->mci_v6_slaac_ip, &cookie)) != in flush_slaac()
1260 txn_cleanup_v6(mac_client_impl_t *mcip) in txn_cleanup_v6() argument
1268 for (txn = avl_first(&mcip->mci_v6_pending_txn); txn != NULL; in txn_cleanup_v6()
1269 txn = avl_walk(&mcip->mci_v6_pending_txn, txn, AVL_AFTER)) { in txn_cleanup_v6()
1272 mac_client_impl_t *, mcip, in txn_cleanup_v6()
1285 avl_remove(&mcip->mci_v6_pending_txn, txn); in txn_cleanup_v6()
1286 release_dhcpv6_cid(mcip, txn->dt_cid); in txn_cleanup_v6()
1290 DTRACE_PROBE2(freeing__txn, mac_client_impl_t *, mcip, in txn_cleanup_v6()
1301 intercept_dhcpv6_outbound(mac_client_impl_t *mcip, ip6_t *ip6h, uchar_t *end) in intercept_dhcpv6_outbound() argument
1308 mac_resource_props_t *mrp = MCIP_RESOURCE_PROPS(mcip); in intercept_dhcpv6_outbound()
1332 mutex_enter(&mcip->mci_protect_lock); in intercept_dhcpv6_outbound()
1334 release_dhcpv6_cid(mcip, cid); in intercept_dhcpv6_outbound()
1338 if ((txn = find_dhcpv6_pending_txn(mcip, xid)) != NULL) { in intercept_dhcpv6_outbound()
1339 DTRACE_PROBE2(update, mac_client_impl_t *, mcip, in intercept_dhcpv6_outbound()
1348 if (insert_dhcpv6_pending_txn(mcip, txn) != 0) { in intercept_dhcpv6_outbound()
1349 DTRACE_PROBE2(insert__failed, mac_client_impl_t *, mcip, in intercept_dhcpv6_outbound()
1354 start_txn_cleanup_timer(mcip); in intercept_dhcpv6_outbound()
1356 DTRACE_PROBE2(txn__pending, mac_client_impl_t *, mcip, in intercept_dhcpv6_outbound()
1363 mutex_exit(&mcip->mci_protect_lock); in intercept_dhcpv6_outbound()
1371 intercept_dhcpv6_inbound(mac_client_impl_t *mcip, uchar_t *end, in intercept_dhcpv6_inbound() argument
1383 mutex_enter(&mcip->mci_protect_lock); in intercept_dhcpv6_inbound()
1385 if ((txn = find_dhcpv6_pending_txn(mcip, xid)) == NULL) { in intercept_dhcpv6_inbound()
1386 DTRACE_PROBE2(txn__not__found, mac_client_impl_t *, mcip, in intercept_dhcpv6_inbound()
1390 remove_dhcpv6_pending_txn(mcip, txn); in intercept_dhcpv6_inbound()
1391 release_dhcpv6_cid(mcip, txn->dt_cid); in intercept_dhcpv6_inbound()
1395 DTRACE_PROBE2(error__status, mac_client_impl_t *, mcip, in intercept_dhcpv6_inbound()
1400 DTRACE_PROBE2(no__addrs, mac_client_impl_t *, mcip, in intercept_dhcpv6_inbound()
1404 if (insert_dhcpv6_cid(mcip, txn->dt_cid) != 0) { in intercept_dhcpv6_inbound()
1405 DTRACE_PROBE2(insert__failed, mac_client_impl_t *, mcip, in intercept_dhcpv6_inbound()
1409 DTRACE_PROBE2(txn__completed, mac_client_impl_t *, mcip, in intercept_dhcpv6_inbound()
1417 mutex_exit(&mcip->mci_protect_lock); in intercept_dhcpv6_inbound()
1424 check_slaac_ip(mac_client_impl_t *mcip, in6_addr_t *addr) in check_slaac_ip() argument
1428 mutex_enter(&mcip->mci_protect_lock); in check_slaac_ip()
1430 a = avl_find(&mcip->mci_v6_slaac_ip, &tmp_addr, NULL); in check_slaac_ip()
1431 mutex_exit(&mcip->mci_protect_lock); in check_slaac_ip()
1460 insert_slaac_prefix(mac_client_impl_t *mcip, nd_opt_prefix_info_t *po) in insert_slaac_prefix() argument
1463 in6_addr_t *token = &mcip->mci_v6_mac_token; in insert_slaac_prefix()
1465 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in insert_slaac_prefix()
1467 if (avl_numnodes(&mcip->mci_v6_slaac_ip) >= slaac_max_allowed) { in insert_slaac_prefix()
1479 if (!insert_slaac_ip(&mcip->mci_v6_slaac_ip, token, addr)) { in insert_slaac_prefix()
1485 intercept_prefix_info(mac_client_impl_t *mcip, nd_opt_prefix_info_t *po) in intercept_prefix_info() argument
1505 mutex_enter(&mcip->mci_protect_lock); in intercept_prefix_info()
1506 insert_slaac_prefix(mcip, po); in intercept_prefix_info()
1507 mutex_exit(&mcip->mci_protect_lock); in intercept_prefix_info()
1515 intercept_ra_inbound(mac_client_impl_t *mcip, ip6_t *ip6h, uchar_t *end, in intercept_ra_inbound() argument
1539 intercept_prefix_info(mcip, in intercept_ra_inbound()
1554 mac_client_impl_t *mcip = arg; in txn_cleanup_timer() local
1556 mutex_enter(&mcip->mci_protect_lock); in txn_cleanup_timer()
1557 if (mcip->mci_txn_cleanup_tid == 0) { in txn_cleanup_timer()
1559 mutex_exit(&mcip->mci_protect_lock); in txn_cleanup_timer()
1562 mcip->mci_txn_cleanup_tid = 0; in txn_cleanup_timer()
1564 txn_cleanup_v4(mcip); in txn_cleanup_timer()
1565 txn_cleanup_v6(mcip); in txn_cleanup_timer()
1570 if (!avl_is_empty(&mcip->mci_v4_pending_txn) || in txn_cleanup_timer()
1571 !avl_is_empty(&mcip->mci_v6_pending_txn)) { in txn_cleanup_timer()
1572 DTRACE_PROBE1(restarting__timer, mac_client_impl_t *, mcip); in txn_cleanup_timer()
1574 mcip->mci_txn_cleanup_tid = timeout(txn_cleanup_timer, mcip, in txn_cleanup_timer()
1577 mutex_exit(&mcip->mci_protect_lock); in txn_cleanup_timer()
1581 start_txn_cleanup_timer(mac_client_impl_t *mcip) in start_txn_cleanup_timer() argument
1583 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in start_txn_cleanup_timer()
1584 if (mcip->mci_txn_cleanup_tid == 0) { in start_txn_cleanup_timer()
1585 mcip->mci_txn_cleanup_tid = timeout(txn_cleanup_timer, mcip, in start_txn_cleanup_timer()
1591 cancel_txn_cleanup_timer(mac_client_impl_t *mcip) in cancel_txn_cleanup_timer() argument
1595 ASSERT(MUTEX_HELD(&mcip->mci_protect_lock)); in cancel_txn_cleanup_timer()
1601 while ((tid = mcip->mci_txn_cleanup_tid) != 0) { in cancel_txn_cleanup_timer()
1602 mcip->mci_txn_cleanup_tid = 0; in cancel_txn_cleanup_timer()
1603 mutex_exit(&mcip->mci_protect_lock); in cancel_txn_cleanup_timer()
1605 mutex_enter(&mcip->mci_protect_lock); in cancel_txn_cleanup_timer()
1655 mac_protect_intercept_dynamic_one(mac_client_impl_t *mcip, mblk_t *mp) in mac_protect_intercept_dynamic_one() argument
1657 mac_impl_t *mip = mcip->mci_mip; in mac_protect_intercept_dynamic_one()
1665 DTRACE_PROBE2(invalid__header, mac_client_impl_t *, mcip, in mac_protect_intercept_dynamic_one()
1672 DTRACE_PROBE2(invalid__l3, mac_client_impl_t *, mcip, in mac_protect_intercept_dynamic_one()
1686 intercept_dhcpv4_inbound(mcip, end, dh4); in mac_protect_intercept_dynamic_one()
1699 intercept_dhcpv6_inbound(mcip, end, dh6); in mac_protect_intercept_dynamic_one()
1701 intercept_ra_inbound(mcip, ip6h, end, ra); in mac_protect_intercept_dynamic_one()
1711 mac_protect_intercept_dynamic(mac_client_impl_t *mcip, mblk_t *mp) in mac_protect_intercept_dynamic() argument
1716 if ((mcip->mci_state_flags & MCIS_IS_AGGR_PORT) != 0) in mac_protect_intercept_dynamic()
1720 mac_protect_intercept_dynamic_one(mcip, mp); in mac_protect_intercept_dynamic()
1724 mac_protect_flush_dynamic(mac_client_impl_t *mcip) in mac_protect_flush_dynamic() argument
1726 mutex_enter(&mcip->mci_protect_lock); in mac_protect_flush_dynamic()
1727 flush_dhcpv4(mcip); in mac_protect_flush_dynamic()
1728 flush_dhcpv6(mcip); in mac_protect_flush_dynamic()
1729 flush_slaac(mcip); in mac_protect_flush_dynamic()
1730 mutex_exit(&mcip->mci_protect_lock); in mac_protect_flush_dynamic()
1734 mac_protect_cancel_timer(mac_client_impl_t *mcip) in mac_protect_cancel_timer() argument
1736 mutex_enter(&mcip->mci_protect_lock); in mac_protect_cancel_timer()
1737 cancel_txn_cleanup_timer(mcip); in mac_protect_cancel_timer()
1738 mutex_exit(&mcip->mci_protect_lock); in mac_protect_cancel_timer()
1747 ipnospoof_check_v4(mac_client_impl_t *mcip, mac_protect_t *protect, in ipnospoof_check_v4() argument
1779 check_dhcpv4_dyn_ip(mcip, *addr) : B_FALSE); in ipnospoof_check_v4()
1783 ipnospoof_check_v6(mac_client_impl_t *mcip, mac_protect_t *protect, in ipnospoof_check_v6() argument
1792 ((mcip->mci_protect_flags & MPT_FLAG_V6_LOCAL_ADDR_SET) != 0 && in ipnospoof_check_v6()
1793 IN6_ARE_ADDR_EQUAL(&mcip->mci_v6_local_addr, addr))) in ipnospoof_check_v6()
1808 return (check_slaac_ip(mcip, addr) || in ipnospoof_check_v6()
1809 check_dhcpv6_dyn_ip(mcip, addr)); in ipnospoof_check_v6()
1819 ipnospoof_check_ndp(mac_client_impl_t *mcip, mac_protect_t *protect, in ipnospoof_check_ndp() argument
1873 if (!ipnospoof_check_v6(mcip, protect, &na->nd_na_target)) { in ipnospoof_check_ndp()
1875 mac_client_impl_t *, mcip, ip6_t *, ip6h); in ipnospoof_check_ndp()
1912 maclen = mcip->mci_mip->mi_info.mi_addr_length; in ipnospoof_check_ndp()
1915 bcmp(mcip->mci_unicast->ma_addr, in ipnospoof_check_ndp()
1918 mac_client_impl_t *, mcip, ip6_t *, ip6h); in ipnospoof_check_ndp()
1922 DTRACE_PROBE2(ndp__lla__ok, mac_client_impl_t *, mcip, ip6_t *, ip6h); in ipnospoof_check_ndp()
1930 ipnospoof_check(mac_client_impl_t *mcip, mac_protect_t *protect, in ipnospoof_check() argument
1941 DTRACE_PROBE2(invalid__l3, mac_client_impl_t *, mcip, in ipnospoof_check()
1954 if (!ipnospoof_check_v4(mcip, protect, &ipha->ipha_src)) in ipnospoof_check()
1957 if (!intercept_dhcpv4_outbound(mcip, ipha, end)) in ipnospoof_check()
1970 maclen = mcip->mci_mip->mi_info.mi_addr_length; in ipnospoof_check()
1983 bcmp(mcip->mci_unicast->ma_addr, shaddr, maclen) != 0) in ipnospoof_check()
1987 if (!ipnospoof_check_v4(mcip, protect, &spaddr)) in ipnospoof_check()
1997 if (!ipnospoof_check_v6(mcip, protect, &ip6h->ip6_src)) in ipnospoof_check()
2000 if (!ipnospoof_check_ndp(mcip, protect, ip6h, end)) in ipnospoof_check()
2003 if (!intercept_dhcpv6_outbound(mcip, ip6h, end)) in ipnospoof_check()
2032 dhcpnospoof_check_v4(mac_client_impl_t *mcip, mac_protect_t *p, in dhcpnospoof_check_v4() argument
2044 maclen = mcip->mci_mip->mi_info.mi_addr_length; in dhcpnospoof_check_v4()
2046 bcmp(mcip->mci_unicast->ma_addr, dh4->chaddr, maclen) != 0) { in dhcpnospoof_check_v4()
2056 bcmp(mcip->mci_unicast->ma_addr, cid + 1, maclen) == 0) in dhcpnospoof_check_v4()
2063 dhcpnospoof_check_v6(mac_client_impl_t *mcip, mac_protect_t *p, in dhcpnospoof_check_v6() argument
2105 maclen = mcip->mci_mip->mi_info.mi_addr_length; in dhcpnospoof_check_v6()
2107 bcmp(mcip->mci_unicast->ma_addr, lladdr, maclen) == 0) { in dhcpnospoof_check_v6()
2117 dhcpnospoof_check(mac_client_impl_t *mcip, mac_protect_t *protect, in dhcpnospoof_check() argument
2128 DTRACE_PROBE2(invalid__l3, mac_client_impl_t *, mcip, in dhcpnospoof_check()
2141 if (!dhcpnospoof_check_v4(mcip, protect, ipha, end)) in dhcpnospoof_check()
2152 if (!dhcpnospoof_check_v6(mcip, protect, ip6h, end)) in dhcpnospoof_check()
2172 mac_protect_update_v6_local_addr(mac_client_impl_t *mcip) in mac_protect_update_v6_local_addr() argument
2175 in6_addr_t *token = &mcip->mci_v6_mac_token; in mac_protect_update_v6_local_addr()
2176 in6_addr_t *v6addr = &mcip->mci_v6_local_addr; in mac_protect_update_v6_local_addr()
2183 mcip->mci_protect_flags |= MPT_FLAG_V6_LOCAL_ADDR_SET; in mac_protect_update_v6_local_addr()
2191 mac_protect_update_v6_slaac_addr(mac_client_impl_t *mcip) in mac_protect_update_v6_slaac_addr() argument
2195 avl_tree_t *ttp = &temp_tree, *sip = &mcip->mci_v6_slaac_ip; in mac_protect_update_v6_slaac_addr()
2196 in6_addr_t *token = &mcip->mci_v6_mac_token; in mac_protect_update_v6_slaac_addr()
2222 mac_protect_update_mac_token(mac_client_impl_t *mcip) in mac_protect_update_mac_token() argument
2224 uint_t media = mcip->mci_mip->mi_info.mi_media; in mac_protect_update_mac_token()
2225 uint8_t *p, *macaddr = mcip->mci_unicast->ma_addr; in mac_protect_update_mac_token()
2226 in6_addr_t *token = &mcip->mci_v6_mac_token; in mac_protect_update_mac_token()
2240 ASSERT(mcip->mci_mip->mi_info.mi_addr_length == 20); in mac_protect_update_mac_token()
2254 mac_protect_update_v6_local_addr(mcip); in mac_protect_update_mac_token()
2255 mac_protect_update_v6_slaac_addr(mcip); in mac_protect_update_mac_token()
2264 mac_protect_check_one(mac_client_impl_t *mcip, mblk_t *mp) in mac_protect_check_one() argument
2266 mac_impl_t *mip = mcip->mci_mip; in mac_protect_check_one()
2267 mac_resource_props_t *mrp = MCIP_RESOURCE_PROPS(mcip); in mac_protect_check_one()
2278 DTRACE_PROBE2(invalid__header, mac_client_impl_t *, mcip, in mac_protect_check_one()
2287 bcmp(mcip->mci_unicast->ma_addr, mhi.mhi_saddr, in mac_protect_check_one()
2289 BUMP_STAT(mcip, macspoofed); in mac_protect_check_one()
2291 mac_client_impl_t *, mcip, mblk_t *, mp); in mac_protect_check_one()
2303 if (vid != 0 && !mac_client_check_flow_vid(mcip, vid)) { in mac_protect_check_one()
2304 BUMP_STAT(mcip, restricted); in mac_protect_check_one()
2306 mac_client_impl_t *, mcip, mblk_t *, mp); in mac_protect_check_one()
2312 BUMP_STAT(mcip, restricted); in mac_protect_check_one()
2314 mac_client_impl_t *, mcip, mblk_t *, mp); in mac_protect_check_one()
2319 if ((err = ipnospoof_check(mcip, protect, mp, &mhi)) != 0) { in mac_protect_check_one()
2320 BUMP_STAT(mcip, ipspoofed); in mac_protect_check_one()
2322 mac_client_impl_t *, mcip, mblk_t *, mp); in mac_protect_check_one()
2327 if ((err = dhcpnospoof_check(mcip, protect, mp, &mhi)) != 0) { in mac_protect_check_one()
2328 BUMP_STAT(mcip, dhcpspoofed); in mac_protect_check_one()
2330 mac_client_impl_t *, mcip, mblk_t *, mp); in mac_protect_check_one()
2344 mac_client_impl_t *mcip = (mac_client_impl_t *)mch; in mac_protect_check() local
2350 if ((mcip->mci_state_flags & MCIS_IS_AGGR_PORT) != 0) in mac_protect_check()
2357 if (mac_protect_check_one(mcip, mp) == 0) { in mac_protect_check()
2499 mac_client_impl_t *mcip = (mac_client_impl_t *)mch; in mac_protect_set() local
2500 mac_impl_t *mip = mcip->mci_mip; in mac_protect_set()
2516 mac_update_resources(mrp, MCIP_RESOURCE_PROPS(mcip), B_FALSE); in mac_protect_set()
2517 i_mac_notify(((mcip->mci_state_flags & MCIS_IS_VNIC) != 0 ? in mac_protect_set()
2518 mcip->mci_upper_mip : mip), MAC_NOTE_ALLOWED_IPS); in mac_protect_set()
2560 mac_protect_init(mac_client_impl_t *mcip) in mac_protect_init() argument
2562 mutex_init(&mcip->mci_protect_lock, NULL, MUTEX_DRIVER, NULL); in mac_protect_init()
2563 mcip->mci_protect_flags = 0; in mac_protect_init()
2564 mcip->mci_txn_cleanup_tid = 0; in mac_protect_init()
2565 avl_create(&mcip->mci_v4_pending_txn, compare_dhcpv4_xid, in mac_protect_init()
2567 avl_create(&mcip->mci_v4_completed_txn, compare_dhcpv4_cid, in mac_protect_init()
2569 avl_create(&mcip->mci_v4_dyn_ip, compare_dhcpv4_ip, in mac_protect_init()
2571 avl_create(&mcip->mci_v6_pending_txn, compare_dhcpv6_xid, in mac_protect_init()
2573 avl_create(&mcip->mci_v6_cid, compare_dhcpv6_cid, in mac_protect_init()
2575 avl_create(&mcip->mci_v6_dyn_ip, compare_dhcpv6_ip, in mac_protect_init()
2577 avl_create(&mcip->mci_v6_slaac_ip, compare_slaac_ip, in mac_protect_init()
2580 if (mcip->mci_state_flags & MCIS_IS_VNIC) in mac_protect_init()
2581 mcip->mci_protect_flags |= MPT_FLAG_PROMISC_FILTERED; in mac_protect_init()
2585 mac_protect_fini(mac_client_impl_t *mcip) in mac_protect_fini() argument
2587 avl_destroy(&mcip->mci_v6_dyn_ip); in mac_protect_fini()
2588 avl_destroy(&mcip->mci_v6_cid); in mac_protect_fini()
2589 avl_destroy(&mcip->mci_v6_pending_txn); in mac_protect_fini()
2590 avl_destroy(&mcip->mci_v4_dyn_ip); in mac_protect_fini()
2591 avl_destroy(&mcip->mci_v4_completed_txn); in mac_protect_fini()
2592 avl_destroy(&mcip->mci_v4_pending_txn); in mac_protect_fini()
2593 avl_destroy(&mcip->mci_v6_slaac_ip); in mac_protect_fini()
2594 mcip->mci_txn_cleanup_tid = 0; in mac_protect_fini()
2595 mcip->mci_protect_flags = 0; in mac_protect_fini()
2596 mutex_destroy(&mcip->mci_protect_lock); in mac_protect_fini()