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

Function pfsync_multicast_setup

freebsd/netpfil/pf/if_pfsync.c:2366–2389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2364}
2365
2366static int
2367pfsync_multicast_setup(struct pfsync_softc *sc, struct ifnet *ifp,
2368 struct in_mfilter *imf)
2369{
2370 struct ip_moptions *imo = &sc->sc_imo;
2371 int error;
2372
2373 if (!(ifp->if_flags & IFF_MULTICAST))
2374 return (EADDRNOTAVAIL);
2375
2376 imo->imo_multicast_vif = -1;
2377
2378 if ((error = in_joingroup(ifp, &sc->sc_sync_peer, NULL,
2379 &imf->imf_inm)) != 0)
2380 return (error);
2381
2382 ip_mfilter_init(&imo->imo_head);
2383 ip_mfilter_insert(&imo->imo_head, imf);
2384 imo->imo_multicast_ifp = ifp;
2385 imo->imo_multicast_ttl = PFSYNC_DFLTTL;
2386 imo->imo_multicast_loop = 0;
2387
2388 return (0);
2389}
2390
2391static void
2392pfsync_multicast_cleanup(struct pfsync_softc *sc)

Callers 1

pfsyncioctlFunction · 0.85

Calls 3

in_joingroupFunction · 0.85
ip_mfilter_initFunction · 0.50
ip_mfilter_insertFunction · 0.50

Tested by

no test coverage detected