Module Name:    src
Committed By:   christos
Date:           Mon Jun 27 18:35:54 UTC 2016

Modified Files:
        src/sys/netinet6: ip6_output.c

Log Message:
CID 1362905: Initialize ifp early, so that we don't if_put garbage in the
IPSEC case.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/netinet6/ip6_output.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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.170 src/sys/netinet6/ip6_output.c:1.171
--- src/sys/netinet6/ip6_output.c:1.170	Tue Jun 21 06:25:27 2016
+++ src/sys/netinet6/ip6_output.c	Mon Jun 27 14:35:54 2016
@@ -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)

Reply via email to