Don't count IF_DROP()'ed packets as if_oerrors too.
authoruebayasi <uebayasi@openbsd.org>
Mon, 5 Oct 2015 15:52:46 +0000 (15:52 +0000)
committeruebayasi <uebayasi@openbsd.org>
Mon, 5 Oct 2015 15:52:46 +0000 (15:52 +0000)
mpi@ plans to clean-up IF_DROP()'s, but fix consistent use of it for now.

OK dlg@

sys/net/if_bridge.c
sys/net/if_spppsubr.c
sys/net/if_vlan.c
sys/netinet/ip_carp.c

index 53c229b..fda9ba7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_bridge.c,v 1.265 2015/09/29 10:11:40 deraadt Exp $ */
+/*     $OpenBSD: if_bridge.c,v 1.266 2015/10/05 15:52:46 uebayasi Exp $        */
 
 /*
  * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1029,7 +1029,6 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
 
                        if (IF_QFULL(&dst_if->if_snd)) {
                                IF_DROP(&dst_if->if_snd);
-                               sc->sc_if.if_oerrors++;
                                continue;
                        }
                        if (TAILQ_NEXT(p, next) == NULL) {
@@ -1468,7 +1467,6 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *ifp,
 #endif /* NMPW */
                if (IF_QFULL(&dst_if->if_snd)) {
                        IF_DROP(&dst_if->if_snd);
-                       sc->sc_if.if_oerrors++;
                        continue;
                }
 
@@ -1554,7 +1552,6 @@ bridge_span(struct bridge_softc *sc, struct mbuf *m)
 
                if (IF_QFULL(&ifp->if_snd)) {
                        IF_DROP(&ifp->if_snd);
-                       sc->sc_if.if_oerrors++;
                        continue;
                }
 
index 7387ace..6383d09 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_spppsubr.c,v 1.139 2015/09/30 12:19:34 sthen Exp $ */
+/*     $OpenBSD: if_spppsubr.c,v 1.140 2015/10/05 15:52:46 uebayasi Exp $      */
 /*
  * Synchronous PPP link level subroutines.
  *
@@ -1024,7 +1024,6 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
        if (IF_QFULL (&sp->pp_cpq)) {
                IF_DROP (&ifp->if_snd);
                m_freem (m);
-               ++ifp->if_oerrors;
                m = NULL;
        } else
                IF_ENQUEUE (&sp->pp_cpq, m);
@@ -4131,7 +4130,6 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
        if (IF_QFULL (&sp->pp_cpq)) {
                IF_DROP (&ifp->if_snd);
                m_freem (m);
-               ++ifp->if_oerrors;
                m = NULL;
        } else
                IF_ENQUEUE (&sp->pp_cpq, m);
index 393fd07..48aff35 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_vlan.c,v 1.143 2015/09/29 10:11:40 deraadt Exp $   */
+/*     $OpenBSD: if_vlan.c,v 1.144 2015/10/05 15:52:46 uebayasi Exp $  */
 
 /*
  * Copyright 1998 Massachusetts Institute of Technology
@@ -249,7 +249,6 @@ vlan_start(struct ifnet *ifp)
                if ((p->if_flags & (IFF_UP|IFF_RUNNING)) !=
                    (IFF_UP|IFF_RUNNING)) {
                        IF_DROP(&p->if_snd);
-                       ifp->if_oerrors++;
                        m_freem(m);
                        continue;
                }
index e62a649..3d13827 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_carp.c,v 1.273 2015/09/28 08:36:24 mpi Exp $       */
+/*     $OpenBSD: ip_carp.c,v 1.274 2015/10/05 15:52:46 uebayasi Exp $  */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -2390,7 +2390,6 @@ carp_start(struct ifnet *ifp)
                if ((ifp->if_carpdev->if_flags & (IFF_UP|IFF_RUNNING)) !=
                    (IFF_UP|IFF_RUNNING)) {
                        IF_DROP(&ifp->if_carpdev->if_snd);
-                       ifp->if_oerrors++;
                        m_freem(m);
                        continue;
                }