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

Function carp_multicast_cleanup

freebsd/netinet/ip_carp.c:1476–1515  ·  view source on GitHub ↗

* Free multicast structures. */

Source from the content-addressed store, hash-verified

1474 * Free multicast structures.
1475 */
1476static void
1477carp_multicast_cleanup(struct carp_if *cif, sa_family_t sa)
1478{
1479#ifdef INET
1480 struct ip_moptions *imo = &cif->cif_imo;
1481 struct in_mfilter *imf;
1482#endif
1483#ifdef INET6
1484 struct ip6_moptions *im6o = &cif->cif_im6o;
1485 struct in6_mfilter *im6f;
1486#endif
1487 sx_assert(&carp_sx, SA_XLOCKED);
1488
1489 switch (sa) {
1490#ifdef INET
1491 case AF_INET:
1492 if (cif->cif_naddrs != 0)
1493 break;
1494
1495 while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) {
1496 ip_mfilter_remove(&imo->imo_head, imf);
1497 in_leavegroup(imf->imf_inm, NULL);
1498 ip_mfilter_free(imf);
1499 }
1500 break;
1501#endif
1502#ifdef INET6
1503 case AF_INET6:
1504 if (cif->cif_naddrs6 != 0)
1505 break;
1506
1507 while ((im6f = ip6_mfilter_first(&im6o->im6o_head)) != NULL) {
1508 ip6_mfilter_remove(&im6o->im6o_head, im6f);
1509 in6_leavegroup(im6f->im6f_in6m, NULL);
1510 ip6_mfilter_free(im6f);
1511 }
1512 break;
1513#endif
1514 }
1515}
1516
1517int
1518carp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa)

Callers 1

carp_detachFunction · 0.85

Calls 8

in_leavegroupFunction · 0.85
ip_mfilter_freeFunction · 0.85
in6_leavegroupFunction · 0.85
ip6_mfilter_freeFunction · 0.85
ip_mfilter_firstFunction · 0.70
ip_mfilter_removeFunction · 0.70
ip6_mfilter_firstFunction · 0.50
ip6_mfilter_removeFunction · 0.50

Tested by

no test coverage detected