FreeBSD/sys/netinet6/in6_mcast.c
/*
 * Discard the IPv6 multicast options (and source filters).
 *
 * SMPng: NOTE: assumes INP write lock is held.
 */
Discard the IPv6 multicast options (and source filters).
SMPng: NOTE: assumes INP write lock is held.
Discard the IPv6 multicast options ( and source filters ) . SMPng : NOTE : assumes INP write lock is held .
void
ip6_freemoptions(struct ip6_moptions *imo)
{
	struct in6_mfilter	*imf;
	size_t			 idx, nmships;
	KASSERT(imo != NULL, ("%s: ip6_moptions is NULL", __func__));
	nmships = imo->im6o_num_memberships;
	for (idx = 0; idx < nmships; ++idx) {
		imf = imo->im6o_mfilters ? &imo->im6o_mfilters[idx] : NULL;
		if (imf)
			im6f_leave(imf);
		(void)in6_mc_leave(imo->im6o_membership[idx], imf);
		if (imf)
			im6f_purge(imf);
	}
	if (imo->im6o_mfilters)
		free(imo->im6o_mfilters, M_IN6MFILTER);
	free(imo->im6o_membership, M_IP6MOPTS);
	free(imo, M_IP6MOPTS);
}
void ip6_freemoptions ( struct ip6_moptions * imo ) { struct in6_mfilter * imf ; size_t idx , nmships ; KASSERT ( imo != NULL , ( " " , __func__ ) ) ; nmships = imo -> im6o_num_memberships ; for ( idx = 0 ; idx < nmships ; ++ idx ) { imf = imo -> im6o_mfilters ? & imo -> im6o_mfilters [ idx ] : NULL ; if ( imf ) im6f_leave ( imf ) ; ( void ) in6_mc_leave ( imo -> im6o_membership [ idx ] , imf ) ; if ( imf ) im6f_purge ( imf ) ; } if ( imo -> im6o_mfilters ) free ( imo -> im6o_mfilters , M_IN6MFILTER ) ; free ( imo -> im6o_membership , M_IP6MOPTS ) ; free ( imo , M_IP6MOPTS ) ; }
Discard the IPv6 multicast options (and source filters).
Discard the IPv6 multicast options ( and source filters ) .
/* XXX this will thrash the lock(s) */