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

Function inm_release

freebsd/netinet/in_mcast.c:624–651  ·  view source on GitHub ↗

* Drop a reference to an in_multi record. * * If the refcount drops to 0, free the in_multi record and * delete the underlying link-layer membership. */

Source from the content-addressed store, hash-verified

622 * delete the underlying link-layer membership.
623 */
624static void
625inm_release(struct in_multi *inm)
626{
627 struct ifmultiaddr *ifma;
628 struct ifnet *ifp;
629
630 CTR2(KTR_IGMPV3, "%s: refcount is %d", __func__, inm->inm_refcount);
631 MPASS(inm->inm_refcount == 0);
632 CTR2(KTR_IGMPV3, "%s: freeing inm %p", __func__, inm);
633
634 ifma = inm->inm_ifma;
635 ifp = inm->inm_ifp;
636
637 /* XXX this access is not covered by IF_ADDR_LOCK */
638 CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma);
639 if (ifp != NULL) {
640 CURVNET_SET(ifp->if_vnet);
641 inm_purge(inm);
642 free(inm, M_IPMADDR);
643 if_delmulti_ifma_flags(ifma, 1);
644 CURVNET_RESTORE();
645 if_rele(ifp);
646 } else {
647 inm_purge(inm);
648 free(inm, M_IPMADDR);
649 if_delmulti_ifma_flags(ifma, 1);
650 }
651}
652
653/*
654 * Clear recorded source entries for a group.

Callers 1

inm_release_taskFunction · 0.85

Calls 4

inm_purgeFunction · 0.85
if_delmulti_ifma_flagsFunction · 0.85
if_releFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected