summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2012-08-19 08:16:13 +0000
committertrociny <trociny@FreeBSD.org>2012-08-19 08:16:13 +0000
commit4b20dde343adae4e0131cbd74bae76afe8abf19b (patch)
tree8806563911447e67fcdf89b14fe78e7e5129613e /sys/netinet6
parent9f3e00996f364939fd7f6929ca9c5ad3ff0af8ec (diff)
downloadFreeBSD-src-4b20dde343adae4e0131cbd74bae76afe8abf19b.zip
FreeBSD-src-4b20dde343adae4e0131cbd74bae76afe8abf19b.tar.gz
In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK.
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 1fdedf1..df5ec0f 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1615,18 +1615,22 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt)
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)
@@ -1880,6 +1884,7 @@ do { \
if (error)
break;
+ INP_WLOCK(in6p);
switch (optval) {
case IPV6_PORTRANGE_DEFAULT:
in6p->inp_flags &= ~(INP_LOWPORT);
@@ -1900,6 +1905,7 @@ do { \
error = EINVAL;
break;
}
+ INP_WUNLOCK(in6p);
break;
#ifdef IPSEC
OpenPOWER on IntegriCloud