FreeBSD/sys/netinet6/in6_mcast.c
/*
 * Join a multicast address w/o sources.
 * KAME compatibility entry point.
 *
 * SMPng: Assume no mc locks held by caller.
 */
Join a multicast address w/o sources.
KAME compatibility entry point.

Assume no mc locks held by caller.
Join a multicast address w / o sources . KAME compatibility entry point . Assume no mc locks held by caller .
struct in6_multi_mship *
in6_joingroup(struct ifnet *ifp, struct in6_addr *mcaddr,
    int *errorp, int delay)
{
	struct in6_multi_mship *imm;
	int error;
	imm = malloc(sizeof(*imm), M_IP6MADDR, M_NOWAIT);
	if (imm == NULL) {
		*errorp = ENOBUFS;
		return (NULL);
	}
	delay = (delay * PR_FASTHZ) / hz;
	error = in6_mc_join(ifp, mcaddr, NULL, &imm->i6mm_maddr, delay);
	if (error) {
		*errorp = error;
		free(imm, M_IP6MADDR);
		return (NULL);
	}
	return (imm);
}
struct in6_multi_mship * in6_joingroup ( struct ifnet * ifp , struct in6_addr * mcaddr , int * errorp , int delay ) { struct in6_multi_mship * imm ; int error ; imm = malloc ( sizeof ( * imm ) , M_IP6MADDR , M_NOWAIT ) ; if ( imm == NULL ) { * errorp = ENOBUFS ; return ( NULL ) ; } delay = ( delay * PR_FASTHZ ) / hz ; error = in6_mc_join ( ifp , mcaddr , NULL , & imm -> i6mm_maddr , delay ) ; if ( error ) { * errorp = error ; free ( imm , M_IP6MADDR ) ; return ( NULL ) ; } return ( imm ) ; }
Join a multicast address w/o sources.
Join a multicast address w / o sources .