| 857 | } |
| 858 | |
| 859 | static void |
| 860 | in6_purgemaddrs(struct ifnet *ifp) |
| 861 | { |
| 862 | struct in6_multi_head inmh; |
| 863 | |
| 864 | SLIST_INIT(&inmh); |
| 865 | IN6_MULTI_LOCK(); |
| 866 | IN6_MULTI_LIST_LOCK(); |
| 867 | mld_ifdetach(ifp, &inmh); |
| 868 | IN6_MULTI_LIST_UNLOCK(); |
| 869 | IN6_MULTI_UNLOCK(); |
| 870 | in6m_release_list_deferred(&inmh); |
| 871 | |
| 872 | /* |
| 873 | * Make sure all multicast deletions invoking if_ioctl() are |
| 874 | * completed before returning. Else we risk accessing a freed |
| 875 | * ifnet structure pointer. |
| 876 | */ |
| 877 | in6m_release_wait(NULL); |
| 878 | } |
| 879 | |
| 880 | void |
| 881 | in6_ifattach_destroy(void) |
no test coverage detected