-/* $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
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
}
/* 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) &&