Index: head/sys/net/if_lagg.c =================================================================== --- head/sys/net/if_lagg.c +++ head/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); } @@ -2145,31 +2142,28 @@ errors++; break; } - - ret = lagg_enqueue(last->lp_ifp, m0); - if (ret != 0) - errors++; + lagg_enqueue(last->lp_ifp, m0); } last = lp; } if (last == NULL) { + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (ENOENT); } if ((last = lagg_link_active(sc, last)) == NULL) { + errors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, errors); m_freem(m); return (ENETDOWN); } ret = lagg_enqueue(last->lp_ifp, m); - if (ret != 0) - errors++; + if (errors != 0) + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, errors); - if (errors == 0) - return (ret); - - return (0); + return (ret); } static struct mbuf* @@ -2192,6 +2186,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 +2310,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 +2382,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); }