Index: sys/net/if_lagg.c =================================================================== --- sys/net/if_lagg.c +++ sys/net/if_lagg.c @@ -1874,10 +1874,6 @@ error = lagg_proto_start(sc, m); LAGG_RUNLOCK(); - - if (error != 0) - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return (error); } @@ -2100,6 +2096,7 @@ * port if the link is down or the port is NULL. */ if ((lp = lagg_link_active(sc, lp)) == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (ENETDOWN); } @@ -2127,6 +2124,7 @@ { int active_ports = 0; int errors = 0; + int enc_errors = 0; int ret; struct lagg_port *lp, *last = NULL; struct mbuf *m0; @@ -2147,27 +2145,38 @@ } ret = lagg_enqueue(last->lp_ifp, m0); - if (ret != 0) + if (ret != 0) { errors++; + enc_errors++; + } } last = lp; } if (last == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, + errors - enc_errors); m_freem(m); return (ENOENT); } if ((last = lagg_link_active(sc, last)) == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, + errors - enc_errors); m_freem(m); return (ENETDOWN); } ret = lagg_enqueue(last->lp_ifp, m); - if (ret != 0) + if (ret != 0) { errors++; + enc_errors++; + } if (errors == 0) return (ret); + else + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, + errors - enc_errors); return (0); } @@ -2192,6 +2201,7 @@ /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (ENETDOWN); } @@ -2315,6 +2325,7 @@ * port if the link is down or the port is NULL. */ if ((lp = lagg_link_active(sc, lp)) == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (ENETDOWN); } @@ -2386,6 +2397,7 @@ lp = lacp_select_tx_port(sc, m); if (lp == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (ENETDOWN); }