* Disable multicast forwarding. */
| 700 | * Disable multicast forwarding. |
| 701 | */ |
| 702 | static int |
| 703 | X_ip_mrouter_done(void) |
| 704 | { |
| 705 | struct ifnet *ifp; |
| 706 | u_long i; |
| 707 | vifi_t vifi; |
| 708 | |
| 709 | MROUTER_LOCK(); |
| 710 | |
| 711 | if (V_ip_mrouter == NULL) { |
| 712 | MROUTER_UNLOCK(); |
| 713 | return EINVAL; |
| 714 | } |
| 715 | |
| 716 | /* |
| 717 | * Detach/disable hooks to the reset of the system. |
| 718 | */ |
| 719 | V_ip_mrouter = NULL; |
| 720 | ip_mrouter_cnt--; |
| 721 | V_mrt_api_config = 0; |
| 722 | |
| 723 | VIF_LOCK(); |
| 724 | |
| 725 | /* |
| 726 | * For each phyint in use, disable promiscuous reception of all IP |
| 727 | * multicasts. |
| 728 | */ |
| 729 | for (vifi = 0; vifi < V_numvifs; vifi++) { |
| 730 | if (!in_nullhost(V_viftable[vifi].v_lcl_addr) && |
| 731 | !(V_viftable[vifi].v_flags & (VIFF_TUNNEL | VIFF_REGISTER))) { |
| 732 | ifp = V_viftable[vifi].v_ifp; |
| 733 | if_allmulti(ifp, 0); |
| 734 | } |
| 735 | } |
| 736 | bzero((caddr_t)V_viftable, sizeof(*V_viftable) * MAXVIFS); |
| 737 | V_numvifs = 0; |
| 738 | V_pim_assert_enabled = 0; |
| 739 | |
| 740 | VIF_UNLOCK(); |
| 741 | |
| 742 | callout_stop(&V_expire_upcalls_ch); |
| 743 | callout_stop(&V_bw_upcalls_ch); |
| 744 | callout_stop(&V_bw_meter_ch); |
| 745 | |
| 746 | MFC_LOCK(); |
| 747 | |
| 748 | /* |
| 749 | * Free all multicast forwarding cache entries. |
| 750 | * Do not use hashdestroy(), as we must perform other cleanup. |
| 751 | */ |
| 752 | for (i = 0; i < mfchashsize; i++) { |
| 753 | struct mfc *rt, *nrt; |
| 754 | |
| 755 | LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { |
| 756 | expire_mfc(rt); |
| 757 | } |
| 758 | } |
| 759 | free(V_mfchashtbl, M_MRTABLE); |
nothing calls this directly
no test coverage detected