Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Fix splx isn't called on some error paths
details: https://anonhg.NetBSD.org/src/rev/15ea6a42b968
branches: trunk
changeset: 355100:15ea6a42b968
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Jul 13 01:48:52 2017 +0000
description:
Fix splx isn't called on some error paths
diffstat:
sys/netipsec/ipsec_output.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r d05aab58dcd8 -r 15ea6a42b968 sys/netipsec/ipsec_output.c
--- a/sys/netipsec/ipsec_output.c Thu Jul 13 01:22:44 2017 +0000
+++ b/sys/netipsec/ipsec_output.c Thu Jul 13 01:48:52 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec_output.c,v 1.52 2017/07/13 01:22:44 ozaki-r Exp $ */
+/* $NetBSD: ipsec_output.c,v 1.53 2017/07/13 01:48:52 ozaki-r Exp $ */
/*-
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.52 2017/07/13 01:22:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.53 2017/07/13 01:48:52 ozaki-r Exp $");
/*
* IPsec output processing.
@@ -712,14 +712,17 @@
struct mbuf *mp;
/* Fix IPv6 header payload length. */
- if (m->m_len < sizeof(struct ip6_hdr))
- if ((m = m_pullup(m,sizeof(struct ip6_hdr))) == NULL)
- return ENOBUFS;
+ if (m->m_len < sizeof(struct ip6_hdr)) {
+ if ((m = m_pullup(m,sizeof(struct ip6_hdr))) == NULL) {
+ error = ENOBUFS;
+ goto bad;
+ }
+ }
if (m->m_pkthdr.len - sizeof(*ip6) > IPV6_MAXPACKET) {
/* No jumbogram support. */
- m_freem(m);
- return ENXIO; /*XXX*/
+ error = ENXIO; /*XXX*/
+ goto bad;
}
ip6 = mtod(m, struct ip6_hdr *);
Home |
Main Index |
Thread Index |
Old Index