diff options
Diffstat (limited to 'sys/netinet/ip_esp.c')
-rw-r--r-- | sys/netinet/ip_esp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 990ceb59a80..03c24919305 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.157 2018/07/12 15:51:50 mpi Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.158 2018/08/28 15:15:02 mpi Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -338,6 +338,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) struct tdb_crypto *tc = NULL; int plen, alen, hlen, error; u_int32_t btsx, esn; + u_int64_t ibytes; #ifdef ENCDEBUG char buf[INET6_ADDRSTRLEN]; #endif @@ -415,8 +416,10 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) } /* Update the counters */ - tdb->tdb_cur_bytes += m->m_pkthdr.len - skip - hlen - alen; - espstat_add(esps_ibytes, m->m_pkthdr.len - skip - hlen - alen); + ibytes = m->m_pkthdr.len - skip - hlen - alen; + tdb->tdb_cur_bytes += ibytes; + tdb->tdb_ibytes += ibytes; + espstat_add(esps_ibytes, ibytes); /* Hard expiration */ if ((tdb->tdb_flags & TDBF_BYTES) && |