From 46fc8350b09b1817273c8eceb5a998320b77030b Mon Sep 17 00:00:00 2001 From: tobhe Date: Thu, 21 Oct 2021 08:39:33 +0000 Subject: [PATCH] Remove duplicate variable ibytes, use plen instead. ok bluhm@ --- sys/netinet/ip_esp.c | 10 ++++------ 1 file 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) && -- 2.20.1