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

Function im6s_merge

freebsd/netinet6/in6_mcast.c:955–981  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

953 * If rollback is non-zero, perform the inverse of the merge.
954 */
955static void
956im6s_merge(struct ip6_msource *ims, const struct in6_msource *lims,
957 const int rollback)
958{
959 int n = rollback ? -1 : 1;
960#ifdef KTR
961 char ip6tbuf[INET6_ADDRSTRLEN];
962
963 ip6_sprintf(ip6tbuf, &lims->im6s_addr);
964#endif
965
966 if (lims->im6sl_st[0] == MCAST_EXCLUDE) {
967 CTR3(KTR_MLD, "%s: t1 ex -= %d on %s", __func__, n, ip6tbuf);
968 ims->im6s_st[1].ex -= n;
969 } else if (lims->im6sl_st[0] == MCAST_INCLUDE) {
970 CTR3(KTR_MLD, "%s: t1 in -= %d on %s", __func__, n, ip6tbuf);
971 ims->im6s_st[1].in -= n;
972 }
973
974 if (lims->im6sl_st[1] == MCAST_EXCLUDE) {
975 CTR3(KTR_MLD, "%s: t1 ex += %d on %s", __func__, n, ip6tbuf);
976 ims->im6s_st[1].ex += n;
977 } else if (lims->im6sl_st[1] == MCAST_INCLUDE) {
978 CTR3(KTR_MLD, "%s: t1 in += %d on %s", __func__, n, ip6tbuf);
979 ims->im6s_st[1].in += n;
980 }
981}
982
983/*
984 * Atomically update the global in6_multi state, when a membership's

Callers 1

in6m_mergeFunction · 0.85

Calls 1

ip6_sprintfFunction · 0.85

Tested by

no test coverage detected