* Broadcast mode */
| 2325 | * Broadcast mode |
| 2326 | */ |
| 2327 | static int |
| 2328 | lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m) |
| 2329 | { |
| 2330 | int active_ports = 0; |
| 2331 | int errors = 0; |
| 2332 | int ret; |
| 2333 | struct lagg_port *lp, *last = NULL; |
| 2334 | struct mbuf *m0; |
| 2335 | |
| 2336 | NET_EPOCH_ASSERT(); |
| 2337 | CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { |
| 2338 | if (!LAGG_PORTACTIVE(lp)) |
| 2339 | continue; |
| 2340 | |
| 2341 | active_ports++; |
| 2342 | |
| 2343 | if (last != NULL) { |
| 2344 | m0 = m_copym(m, 0, M_COPYALL, M_NOWAIT); |
| 2345 | if (m0 == NULL) { |
| 2346 | ret = ENOBUFS; |
| 2347 | errors++; |
| 2348 | break; |
| 2349 | } |
| 2350 | lagg_enqueue(last->lp_ifp, m0); |
| 2351 | } |
| 2352 | last = lp; |
| 2353 | } |
| 2354 | |
| 2355 | if (last == NULL) { |
| 2356 | if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); |
| 2357 | m_freem(m); |
| 2358 | return (ENOENT); |
| 2359 | } |
| 2360 | if ((last = lagg_link_active(sc, last)) == NULL) { |
| 2361 | errors++; |
| 2362 | if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, errors); |
| 2363 | m_freem(m); |
| 2364 | return (ENETDOWN); |
| 2365 | } |
| 2366 | |
| 2367 | ret = lagg_enqueue(last->lp_ifp, m); |
| 2368 | if (errors != 0) |
| 2369 | if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, errors); |
| 2370 | |
| 2371 | return (ret); |
| 2372 | } |
| 2373 | |
| 2374 | static struct mbuf* |
| 2375 | lagg_bcast_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) |
nothing calls this directly
no test coverage detected