summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-06-27 18:35:54 +0000
committerchristos <christos@NetBSD.org>2016-06-27 18:35:54 +0000
commitcdb96e1661710027aa315f7874a0d0ccba77b8ca (patch)
treeb0309b842594ec500cdbf6dae1317f3a0364af97 /sys
parentb22c3e270bbcad8fef9bfd4787784b939d992d3d (diff)
CID 1362905: Initialize ifp early, so that we don't if_put garbage in the
IPSEC case.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ip6_output.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c0f982ffaaf..0b92c65a8f4 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_output.c,v 1.170 2016/06/21 10:25:27 ozaki-r Exp $ */
+/* $NetBSD: ip6_output.c,v 1.171 2016/06/27 18:35:54 christos Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.170 2016/06/21 10:25:27 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.171 2016/06/27 18:35:54 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -163,7 +163,7 @@ ip6_output(
)
{
struct ip6_hdr *ip6, *mhip6;
- struct ifnet *ifp, *origifp = NULL;
+ struct ifnet *ifp = NULL, *origifp = NULL;
struct mbuf *m = m0;
int hlen, tlen, len, off;
bool tso;
@@ -491,7 +491,6 @@ ip6_output(
ip6 = mtod(m, struct ip6_hdr *);
sockaddr_in6_init(&dst_sa, &ip6->ip6_dst, 0, 0, 0);
- ifp = NULL;
if ((error = in6_selectroute(&dst_sa, opt, im6o, ro,
&ifp, &psref, &rt, 0)) != 0) {
if (ifp != NULL)