mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK.
MFC after: 2 weeks
This commit is contained in:
parent
9b9bfdcc30
commit
ab16a5bd08
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue