| 2364 | } |
| 2365 | |
| 2366 | static int |
| 2367 | pfsync_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 | |
| 2391 | static void |
| 2392 | pfsync_multicast_cleanup(struct pfsync_softc *sc) |
no test coverage detected