Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec When IP6_EXTHDR_GET fails, return ...
details: https://anonhg.NetBSD.org/src/rev/94a4ff86b48f
branches: trunk
changeset: 318607:94a4ff86b48f
user: maxv <maxv%NetBSD.org@localhost>
date: Tue May 01 08:27:13 2018 +0000
description:
When IP6_EXTHDR_GET fails, return ENOBUFS, and don't log an error (HDROPS
is not supposed to be used here).
diffstat:
sys/netipsec/xform_ah.c | 10 ++++------
sys/netipsec/xform_esp.c | 6 +++---
2 files changed, 7 insertions(+), 9 deletions(-)
diffs (58 lines):
diff -r 4a13fe08e93b -r 94a4ff86b48f sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c Tue May 01 08:17:13 2018 +0000
+++ b/sys/netipsec/xform_ah.c Tue May 01 08:27:13 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_ah.c,v 1.96 2018/05/01 08:16:34 maxv Exp $ */
+/* $NetBSD: xform_ah.c,v 1.97 2018/05/01 08:27:13 maxv Exp $ */
/* $FreeBSD: xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
/*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.96 2018/05/01 08:16:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.97 2018/05/01 08:27:13 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -532,10 +532,8 @@
/* XXX don't pullup, just copy header */
IP6_EXTHDR_GET(ah, struct newah *, m, skip, rplen);
if (ah == NULL) {
- DPRINTF(("%s: cannot pullup header\n", __func__));
- error = ENOBUFS;
- stat = AH_STAT_HDROPS; /*XXX*/
- goto bad;
+ /* m already freed */
+ return ENOBUFS;
}
nxt = ah->ah_nxt;
diff -r 4a13fe08e93b -r 94a4ff86b48f sys/netipsec/xform_esp.c
--- a/sys/netipsec/xform_esp.c Tue May 01 08:17:13 2018 +0000
+++ b/sys/netipsec/xform_esp.c Tue May 01 08:27:13 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_esp.c,v 1.84 2018/05/01 08:16:34 maxv Exp $ */
+/* $NetBSD: xform_esp.c,v 1.85 2018/05/01 08:27:13 maxv Exp $ */
/* $FreeBSD: xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.84 2018/05/01 08:16:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.85 2018/05/01 08:27:13 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -312,7 +312,7 @@
IP6_EXTHDR_GET(esp, struct newesp *, m, skip, sizeof(struct newesp));
if (esp == NULL) {
/* m already freed */
- return EINVAL;
+ return ENOBUFS;
}
esph = sav->tdb_authalgxform;
Home |
Main Index |
Thread Index |
Old Index