summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 06:37:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 06:37:40 +0000
commitb454ec3c7074138afddea405ca1b60f42efe01f7 (patch)
tree7f8ce63cece2ef308ab0ce3798c8b2e8ba034d29
parent2bdddc849c46b84f11335ec6678d463c1006b8e7 (diff)
count packets; from claudio
-rw-r--r--sys/net/if_vether.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c
index f033b107f72..8eec78edd5e 100644
--- a/sys/net/if_vether.c
+++ b/sys/net/if_vether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vether.c,v 1.2 2009/11/09 20:38:33 mpf Exp $ */
+/* $OpenBSD: if_vether.c,v 1.3 2009/11/12 06:37:39 deraadt Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt
@@ -180,10 +180,14 @@ vetherstart(struct ifnet *ifp)
bpf_mtap_ether(ifp->if_bpf, m, inout);
#endif
- if (inout == BPF_DIRECTION_IN)
+ if (inout == BPF_DIRECTION_IN) {
ether_input_mbuf(ifp, m);
- else
+ ifp->if_ipackets++;
+ } else {
+ ifp->if_opackets++;
+ ifp->if_obytes += m->m_pkthdr.len;
m_freem(m);
+ }
}
}