Module Name: src
Committed By: drochner
Date: Thu Feb 17 20:20:18 UTC 2011
Modified Files:
src/sys/netipsec: ipsec_input.c
Log Message:
handle some unlikely IPv6 error case like everywhere else:
free mbuf, inc statcounter. from OpenBSD
being here, fix a diagnostic output
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/netipsec/ipsec_input.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netipsec/ipsec_input.c
diff -u src/sys/netipsec/ipsec_input.c:1.24 src/sys/netipsec/ipsec_input.c:1.25
--- src/sys/netipsec/ipsec_input.c:1.24 Wed Feb 16 18:39:33 2011
+++ src/sys/netipsec/ipsec_input.c Thu Feb 17 20:20:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec_input.c,v 1.24 2011/02/16 18:39:33 drochner Exp $ */
+/* $NetBSD: ipsec_input.c,v 1.25 2011/02/17 20:20:18 drochner Exp $ */
/* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec_input.c,v 1.2.4.2 2003/03/28 20:32:53 sam Exp $ */
/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.24 2011/02/16 18:39:33 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.25 2011/02/17 20:20:18 drochner Exp $");
/*
* IPsec input processing.
@@ -477,6 +477,9 @@
if (*offp < sizeof(struct ip6_hdr)) {
DPRINTF(("ipsec6_common_input: bad offset %u\n", *offp));
+ IPSEC_ISTAT(proto, ESP_STAT_HDROPS, AH_STAT_HDROPS,
+ IPCOMP_STAT_HDROPS);
+ m_freem(*mp);
return IPPROTO_DONE;
} else if (*offp == sizeof(struct ip6_hdr)) {
protoff = offsetof(struct ip6_hdr, ip6_nxt);
@@ -492,7 +495,8 @@
l = (ip6e.ip6e_len + 2) << 2;
else
l = (ip6e.ip6e_len + 1) << 3;
- IPSEC_ASSERT(l > 0, ("ah6_input: l went zero or negative"));
+ IPSEC_ASSERT(l > 0,
+ ("ipsec6_common_input: l went zero or negative"));
} while (protoff + l < *offp);
/* Malformed packet check */