Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Sep 2012 10:39:01 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r239985 - stable/8/sys/netinet6
Message-ID:  <201209011039.q81Ad1Bn095036@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Sat Sep  1 10:39:01 2012
New Revision: 239985
URL: http://svn.freebsd.org/changeset/base/239985

Log:
  MFC r239383:
  
  In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK.

Modified:
  stable/8/sys/netinet6/ip6_output.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/netinet6/ip6_output.c
==============================================================================
--- stable/8/sys/netinet6/ip6_output.c	Sat Sep  1 10:37:41 2012	(r239984)
+++ stable/8/sys/netinet6/ip6_output.c	Sat Sep  1 10:39:01 2012	(r239985)
@@ -1472,18 +1472,22 @@ ip6_ctloutput(struct socket *so, struct 
 					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)
 
@@ -1737,6 +1741,7 @@ do { \
 				if (error)
 					break;
 
+				INP_WLOCK(in6p);
 				switch (optval) {
 				case IPV6_PORTRANGE_DEFAULT:
 					in6p->inp_flags &= ~(INP_LOWPORT);
@@ -1757,6 +1762,7 @@ do { \
 					error = EINVAL;
 					break;
 				}
+				INP_WUNLOCK(in6p);
 				break;
 
 #ifdef IPSEC



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209011039.q81Ad1Bn095036>