summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Heider <tobhe@cvs.openbsd.org>2021-10-21 08:39:34 +0000
committerTobias Heider <tobhe@cvs.openbsd.org>2021-10-21 08:39:34 +0000
commit218c45b1f13c2ba7868844dcf00bd6f867059a0d (patch)
treedcc3111f686afac78596b9def2515286c42dbe18
parent9f4d591f73e6af3351d4e159fbe5f8646556de62 (diff)
Remove duplicate variable ibytes, use plen instead.
ok bluhm@
-rw-r--r--sys/netinet/ip_esp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index eec2887f222..20323ae8c95 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.174 2021/10/13 22:43:44 bluhm Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.175 2021/10/21 08:39:33 tobhe Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -349,7 +349,6 @@ 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
@@ -424,10 +423,9 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
}
/* Update the counters */
- ibytes = m->m_pkthdr.len - skip - hlen - alen;
- tdb->tdb_cur_bytes += ibytes;
- tdb->tdb_ibytes += ibytes;
- espstat_add(esps_ibytes, ibytes);
+ tdb->tdb_cur_bytes += plen;
+ tdb->tdb_ibytes += plen;
+ espstat_add(esps_ibytes, plen);
/* Hard expiration */
if ((tdb->tdb_flags & TDBF_BYTES) &&