Module Name:    src
Committed By:   ozaki-r
Date:           Wed Aug 14 08:34:44 UTC 2019

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

Log Message:
Add missing IFNET_LOCK for regen_tmpaddr

Reported by ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.256 -r1.257 src/sys/netinet6/nd6.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/nd6.c
diff -u src/sys/netinet6/nd6.c:1.256 src/sys/netinet6/nd6.c:1.257
--- src/sys/netinet6/nd6.c:1.256	Fri Jul 26 10:18:42 2019
+++ src/sys/netinet6/nd6.c	Wed Aug 14 08:34:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.256 2019/07/26 10:18:42 christos Exp $	*/
+/*	$NetBSD: nd6.c,v 1.257 2019/08/14 08:34:44 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256 2019/07/26 10:18:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.257 2019/08/14 08:34:44 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -666,8 +666,12 @@ nd6_timer_work(struct work *wk, void *ar
 			if (ip6_use_tempaddr &&
 			    (ia6->ia6_flags & IN6_IFF_TEMPORARY) != 0 &&
 			    (oldflags & IN6_IFF_DEPRECATED) == 0) {
+				int ret;
 
-				if (regen_tmpaddr(ia6) == 0) {
+				IFNET_LOCK(ia6->ia_ifa.ifa_ifp);
+				ret = regen_tmpaddr(ia6);
+				IFNET_UNLOCK(ia6->ia_ifa.ifa_ifp);
+				if (ret == 0) {
 					/*
 					 * A new temporary address is
 					 * generated.

Reply via email to