diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1997-07-14 08:48:48 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1997-07-14 08:48:48 +0000 |
commit | c3a2298d51e059cd301992f6b91d3f3997af4f97 (patch) | |
tree | adb96418b6e9ecbf80d1e69c6ab9cbb935d25e67 /sys/netinet/ip_esp_old.c | |
parent | af2f31378b24787947acccc4300ac8f758a21a6a (diff) |
global byte counters.
Diffstat (limited to 'sys/netinet/ip_esp_old.c')
-rw-r--r-- | sys/netinet/ip_esp_old.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/ip_esp_old.c b/sys/netinet/ip_esp_old.c index dc1ffb1dd81..363b8b45b23 100644 --- a/sys/netinet/ip_esp_old.c +++ b/sys/netinet/ip_esp_old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp_old.c,v 1.1 1997/07/11 23:37:57 provos Exp $ */ +/* $OpenBSD: ip_esp_old.c,v 1.2 1997/07/14 08:48:46 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -480,6 +480,7 @@ esp_old_input(struct mbuf *m, struct tdb *tdb) /* Update the counters */ tdb->tdb_cur_packets++; tdb->tdb_cur_bytes += ntohs(ip->ip_len) - (ip->ip_hl << 2) + blk[6] + 2; + espstat.esps_ibytes += ntohs(ip->ip_len) - (ip->ip_hl << 2) + blk[6] + 2; return m; } @@ -726,6 +727,7 @@ esp_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, /* Update the counters */ tdb->tdb_cur_packets++; tdb->tdb_cur_bytes += rlen + padding; + espstat.esps_obytes += rlen + padding; return 0; } @@ -748,7 +750,13 @@ m_pad(struct mbuf *m, int n) u_int8_t dat; if (n <= 0) /* no stupid arguments */ - return NULL; + { +#ifdef ENCDEBUG + if (encdebug) + printf("m_pad(): pad length invalid (%d)\n", n); +#endif /* ENCDEBUG */ + return NULL; + } len = m->m_pkthdr.len; pad = n; |