Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by knaka...



details:   https://anonhg.NetBSD.org/src/rev/539aa9da8d3c
branches:  netbsd-8
changeset: 434211:539aa9da8d3c
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Aug 14 23:39:24 2017 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #205):
        sys/net/if_vlan.c: revision 1.99
Fix vlan(4) obytes counter. Implemented by s-yamaguchi@IIJ, thanks.

diffstat:

 sys/net/if_vlan.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 87da6f251221 -r 539aa9da8d3c sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Thu Aug 10 07:15:09 2017 +0000
+++ b/sys/net/if_vlan.c Mon Aug 14 23:39:24 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.97.2.1 2017/06/21 17:39:24 snj Exp $     */
+/*     $NetBSD: if_vlan.c,v 1.97.2.2 2017/08/14 23:39:24 snj Exp $     */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.1 2017/06/21 17:39:24 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.2 2017/08/14 23:39:24 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1342,6 +1342,8 @@
        struct ifvlan_linkmib *mib;
        struct psref psref;
        int error;
+       size_t pktlen = m->m_pkthdr.len;
+       bool mcast = (m->m_flags & M_MCAST) != 0;
 
        mib = vlan_getref_linkmib(ifv, &psref);
        if (mib == NULL) {
@@ -1451,10 +1453,11 @@
                /* mbuf is already freed */
                ifp->if_oerrors++;
        } else {
+
                ifp->if_opackets++;
-               /*
-                * obytes is incremented at ether_output() or bridge_enqueue().
-                */
+               ifp->if_obytes += pktlen;
+               if (mcast)
+                       ifp->if_omcasts++;
        }
 
 out:



Home | Main Index | Thread Index | Old Index