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

Function bridge_span

freebsd/net/if_bridge.c:2631–2657  ·  view source on GitHub ↗

* bridge_span: * * Duplicate a packet out one or more interfaces that are in span mode, * the original mbuf is unmodified. */

Source from the content-addressed store, hash-verified

2629 * the original mbuf is unmodified.
2630 */
2631static void
2632bridge_span(struct bridge_softc *sc, struct mbuf *m)
2633{
2634 struct bridge_iflist *bif;
2635 struct ifnet *dst_if;
2636 struct mbuf *mc;
2637
2638 NET_EPOCH_ASSERT();
2639
2640 if (CK_LIST_EMPTY(&sc->sc_spanlist))
2641 return;
2642
2643 CK_LIST_FOREACH(bif, &sc->sc_spanlist, bif_next) {
2644 dst_if = bif->bif_ifp;
2645
2646 if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0)
2647 continue;
2648
2649 mc = m_copypacket(m, M_NOWAIT);
2650 if (mc == NULL) {
2651 if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
2652 continue;
2653 }
2654
2655 bridge_enqueue(sc, dst_if, mc);
2656 }
2657}
2658
2659/*
2660 * bridge_rtupdate:

Callers 2

bridge_outputFunction · 0.85
bridge_inputFunction · 0.85

Calls 3

m_copypacketFunction · 0.85
if_inc_counterFunction · 0.85
bridge_enqueueFunction · 0.85

Tested by

no test coverage detected