From c3a2298d51e059cd301992f6b91d3f3997af4f97 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Mon, 14 Jul 1997 08:48:48 +0000 Subject: global byte counters. --- sys/netinet/ip_ip4.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/netinet/ip_ip4.c') diff --git a/sys/netinet/ip_ip4.c b/sys/netinet/ip_ip4.c index 6416a159f92..ac9331a7439 100644 --- a/sys/netinet/ip_ip4.c +++ b/sys/netinet/ip_ip4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ip4.c,v 1.11 1997/07/11 23:37:58 provos Exp $ */ +/* $OpenBSD: ip_ip4.c,v 1.12 1997/07/14 08:48:47 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -120,7 +120,9 @@ ip4_input(register struct mbuf *m, int iphlen) } ipi = (struct ip *) ((caddr_t) ipo + iphlen); - + + ip4stat.ip4s_ibytes += ntohs(ipi->ip_len); + /* * RFC 1853 specifies that the inner TTL should not be touched on * decapsulation. There's no reason this comment should be here, but @@ -238,6 +240,8 @@ ipe4_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, tdb->tdb_cur_bytes += ntohs(ipo->ip_len) - (ipo->ip_hl << 2); } + ip4stat.ip4s_obytes += ntohs(ipo->ip_len) - (ipo->ip_hl << 2); + return 0; /* return ip_output(m, NULL, NULL, IP_ENCAPSULATED, NULL); */ -- cgit v1.2.3