FreeBSD/sys/netinet6/in6_mcast.c
/*
 * Merge socket-layer source into MLD-layer source.
 * If rollback is non-zero, perform the inverse of the merge.
 */
Merge socket-layer source into MLD-layer source.
If rollback is non-zero, perform the inverse of the merge.
Merge socket - layer source into MLD - layer source . If rollback is non - zero perform the inverse of the merge .
static void
im6s_merge(struct ip6_msource *ims, const struct in6_msource *lims,
    const int rollback)
{
	int n = rollback ? -1 : 1;
#ifdef KTR
	char ip6tbuf[INET6_ADDRSTRLEN];
	ip6_sprintf(ip6tbuf, &lims->im6s_addr);
#endif
	if (lims->im6sl_st[0] == MCAST_EXCLUDE) {
		CTR3(KTR_MLD, "%s: t1 ex -= %d on %s", __func__, n, ip6tbuf);
		ims->im6s_st[1].ex -= n;
	} else if (lims->im6sl_st[0] == MCAST_INCLUDE) {
		CTR3(KTR_MLD, "%s: t1 in -= %d on %s", __func__, n, ip6tbuf);
		ims->im6s_st[1].in -= n;
	}
	if (lims->im6sl_st[1] == MCAST_EXCLUDE) {
		CTR3(KTR_MLD, "%s: t1 ex += %d on %s", __func__, n, ip6tbuf);
		ims->im6s_st[1].ex += n;
	} else if (lims->im6sl_st[1] == MCAST_INCLUDE) {
		CTR3(KTR_MLD, "%s: t1 in += %d on %s", __func__, n, ip6tbuf);
		ims->im6s_st[1].in += n;
	}
}
static void im6s_merge ( struct ip6_msource * ims , const struct in6_msource * lims , const int rollback ) { int n = rollback ? -1 : 1 ; #ifdef KTR char ip6tbuf [ INET6_ADDRSTRLEN ] ; ip6_sprintf ( ip6tbuf , & lims -> im6s_addr ) ; #endif if ( lims -> im6sl_st [ 0 ] == MCAST_EXCLUDE ) { CTR3 ( KTR_MLD , " " , __func__ , n , ip6tbuf ) ; ims -> im6s_st [ 1 ] . ex -= n ; } else if ( lims -> im6sl_st [ 0 ] == MCAST_INCLUDE ) { CTR3 ( KTR_MLD , " " , __func__ , n , ip6tbuf ) ; ims -> im6s_st [ 1 ] . in -= n ; } if ( lims -> im6sl_st [ 1 ] == MCAST_EXCLUDE ) { CTR3 ( KTR_MLD , " " , __func__ , n , ip6tbuf ) ; ims -> im6s_st [ 1 ] . ex += n ; } else if ( lims -> im6sl_st [ 1 ] == MCAST_INCLUDE ) { CTR3 ( KTR_MLD , " " , __func__ , n , ip6tbuf ) ; ims -> im6s_st [ 1 ] . in += n ; } }
Merge socket-layer source into MLD-layer source.
Merge socket - layer source into MLD - layer source .