[Midnightbsd-cvs] src [7973] trunk/sys/netinet6/ip6_output.c: guard inp_flags modifcations with INP_WLOCK

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 15 04:16:37 EDT 2016


Revision: 7973
          http://svnweb.midnightbsd.org/src/?rev=7973
Author:   laffer1
Date:     2016-09-15 04:16:37 -0400 (Thu, 15 Sep 2016)
Log Message:
-----------
guard inp_flags modifcations with INP_WLOCK

Modified Paths:
--------------
    trunk/sys/netinet6/ip6_output.c

Modified: trunk/sys/netinet6/ip6_output.c
===================================================================
--- trunk/sys/netinet6/ip6_output.c	2016-09-15 08:10:51 UTC (rev 7972)
+++ trunk/sys/netinet6/ip6_output.c	2016-09-15 08:16:37 UTC (rev 7973)
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD: src/sys/netinet6/ip6_output.c,v 1.6 2013/01/17 23:29:41 laffer1 Exp $");
+__MBSDID("$MidnightBSD$");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1619,18 +1619,22 @@
 					break;
 #define OPTSET(bit) \
 do { \
+	INP_WLOCK(in6p); \
 	if (optval) \
 		in6p->inp_flags |= (bit); \
 	else \
 		in6p->inp_flags &= ~(bit); \
+	INP_WUNLOCK(in6p); \
 } while (/*CONSTCOND*/ 0)
 #define OPTSET2292(bit) \
 do { \
+	INP_WLOCK(in6p); \
 	in6p->inp_flags |= IN6P_RFC2292; \
 	if (optval) \
 		in6p->inp_flags |= (bit); \
 	else \
 		in6p->inp_flags &= ~(bit); \
+	INP_WUNLOCK(in6p); \
 } while (/*CONSTCOND*/ 0)
 #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0)
 
@@ -1884,6 +1888,7 @@
 				if (error)
 					break;
 
+				INP_WLOCK(in6p);
 				switch (optval) {
 				case IPV6_PORTRANGE_DEFAULT:
 					in6p->inp_flags &= ~(INP_LOWPORT);
@@ -1904,6 +1909,7 @@
 					error = EINVAL;
 					break;
 				}
+				INP_WUNLOCK(in6p);
 				break;
 
 #ifdef IPSEC



More information about the Midnightbsd-cvs mailing list