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

Function imf_reap

freebsd/netinet/in_mcast.c:904–920  ·  view source on GitHub ↗

* Reap unreferenced sources from socket-layer filter set. */

Source from the content-addressed store, hash-verified

902 * Reap unreferenced sources from socket-layer filter set.
903 */
904static void
905imf_reap(struct in_mfilter *imf)
906{
907 struct ip_msource *ims, *tims;
908 struct in_msource *lims;
909
910 RB_FOREACH_SAFE(ims, ip_msource_tree, &imf->imf_sources, tims) {
911 lims = (struct in_msource *)ims;
912 if ((lims->imsl_st[0] == MCAST_UNDEFINED) &&
913 (lims->imsl_st[1] == MCAST_UNDEFINED)) {
914 CTR2(KTR_IGMPV3, "%s: free lims %p", __func__, ims);
915 RB_REMOVE(ip_msource_tree, &imf->imf_sources, ims);
916 free(ims, M_INMFILTER);
917 imf->imf_nsrc--;
918 }
919 }
920}
921
922/*
923 * Purge socket-layer filter set.

Callers 4

inp_block_unblock_sourceFunction · 0.85
inp_join_groupFunction · 0.85
inp_leave_groupFunction · 0.85
inp_set_source_filtersFunction · 0.85

Calls 1

freeFunction · 0.50

Tested by

no test coverage detected