MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ims_merge

Function ims_merge

freebsd/netinet/in_mcast.c:986–1011  ·  view source on GitHub ↗

* Merge socket-layer source into IGMP-layer source. * If rollback is non-zero, perform the inverse of the merge. */

Source from the content-addressed store, hash-verified

984 * If rollback is non-zero, perform the inverse of the merge.
985 */
986static void
987ims_merge(struct ip_msource *ims, const struct in_msource *lims,
988 const int rollback)
989{
990 int n = rollback ? -1 : 1;
991
992 if (lims->imsl_st[0] == MCAST_EXCLUDE) {
993 CTR3(KTR_IGMPV3, "%s: t1 ex -= %d on 0x%08x",
994 __func__, n, ims->ims_haddr);
995 ims->ims_st[1].ex -= n;
996 } else if (lims->imsl_st[0] == MCAST_INCLUDE) {
997 CTR3(KTR_IGMPV3, "%s: t1 in -= %d on 0x%08x",
998 __func__, n, ims->ims_haddr);
999 ims->ims_st[1].in -= n;
1000 }
1001
1002 if (lims->imsl_st[1] == MCAST_EXCLUDE) {
1003 CTR3(KTR_IGMPV3, "%s: t1 ex += %d on 0x%08x",
1004 __func__, n, ims->ims_haddr);
1005 ims->ims_st[1].ex += n;
1006 } else if (lims->imsl_st[1] == MCAST_INCLUDE) {
1007 CTR3(KTR_IGMPV3, "%s: t1 in += %d on 0x%08x",
1008 __func__, n, ims->ims_haddr);
1009 ims->ims_st[1].in += n;
1010 }
1011}
1012
1013/*
1014 * Atomically update the global in_multi state, when a membership's

Callers 1

inm_mergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected