summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2003-02-19 19:15:13 +0000
committerjason <jason@openbsd.org>2003-02-19 19:15:13 +0000
commit69d877b59084869f25a0a6582adf410bad9c4cf4 (patch)
tree3359e1aa497507c387cbd416a4802eea7e0788ef
parentFix little buffer overflow on 64-bit platforms. (diff)
downloadwireguard-openbsd-69d877b59084869f25a0a6582adf410bad9c4cf4.tar.xz
wireguard-openbsd-69d877b59084869f25a0a6582adf410bad9c4cf4.zip
add a counter for times ipcomp is skipped because the packet is below the
minimum compression threshold.
-rw-r--r--sys/netinet/ipsec_output.c5
-rw-r--r--usr.bin/netstat/inet.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index 719e707a839..903fb87cd4b 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.25 2002/08/28 15:43:03 pefo Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.26 2003/02/19 19:15:13 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -306,7 +306,10 @@ ipsp_process_packet(struct mbuf *m, struct tdb *tdb, int af, int tunalready)
/* Non expansion policy for IPCOMP */
if (tdb->tdb_sproto == IPPROTO_IPCOMP) {
if ((m->m_pkthdr.len - i) < tdb->tdb_compalgxform->minlen) {
+ extern struct ipcompstat ipcompstat;
+
/* No need to compress, leave the packet untouched */
+ ipcompstat.ipcomps_minlen++;
return ipsp_process_done(m, tdb);
}
}
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index e75be36f6de..8467cfb51f0 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.63 2003/02/01 01:51:31 deraadt Exp $ */
+/* $OpenBSD: inet.c,v 1.64 2003/02/19 19:15:13 jason Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-static char *rcsid = "$OpenBSD: inet.c,v 1.63 2003/02/01 01:51:31 deraadt Exp $";
+static char *rcsid = "$OpenBSD: inet.c,v 1.64 2003/02/19 19:15:13 jason Exp $";
#endif
#endif /* not lint */
@@ -840,6 +840,7 @@ ipcomp_stats(u_long off, char *name)
p(ipcomps_invalid, "\t%u packet%s attempted to use an invalid TDB\n");
p(ipcomps_toobig, "\t%u packet%s got larger than max IP packet size\n");
p(ipcomps_crypto, "\t%u packet%s that failed (de)compression processing\n");
+ p(ipcomps_minlen, "\t%u packet%s less than minimum compression length\n");
p(ipcomps_ibytes, "\t%qu input byte%s\n");
p(ipcomps_obytes, "\t%qu output byte%s\n");