Module Name:    src
Committed By:   snj
Date:           Sat Jul  1 08:51:04 UTC 2017

Modified Files:
        src/sys/netinet6 [netbsd-8]: ip6_output.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #73):
        sys/netinet6/ip6_output.c: revision 1.192
Fix usage of ip6_get_membership
It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.
Fix PR kern/52324


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.191.6.1 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.191 src/sys/netinet6/ip6_output.c:1.191.6.1
--- src/sys/netinet6/ip6_output.c:1.191	Fri Mar  3 07:13:06 2017
+++ src/sys/netinet6/ip6_output.c	Sat Jul  1 08:51:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.191 2017/03/03 07:13:06 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.191.6.1 2017/07/01 08:51:04 snj 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.191 2017/03/03 07:13:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.191.6.1 2017/07/01 08:51:04 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2561,8 +2561,10 @@ ip6_setmoptions(const struct sockopt *so
 		 * Group must be a valid IP6 multicast address.
 		 */
 		bound = curlwp_bind();
+		ifp = NULL;
 		error = ip6_get_membership(sopt, &ifp, &psref, &ia, sizeof(ia));
 		if (error != 0) {
+			KASSERT(ifp == NULL);
 			curlwp_bindx(bound);
 			return error;
 		}

Reply via email to