diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-24 04:28:30 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-24 04:28:30 +0000 |
commit | 5b148b0cd40b22f7238cef6d2b77bde452dccc49 (patch) | |
tree | 5e648c26fbaf35735666411dae58a02bae589cf3 /sys/kern/uipc_socket.c | |
parent | 856e57e291cf451220a7c3a99ee6eafc5791133c (diff) | |
download | FreeBSD-src-5b148b0cd40b22f7238cef6d2b77bde452dccc49.zip FreeBSD-src-5b148b0cd40b22f7238cef6d2b77bde452dccc49.tar.gz |
Lock socket buffers when processing setting socket options SO_SNDLOWAT
or SO_RCVLOWAT for read-modify-write.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index fe99fe7..21ed076 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1495,14 +1495,18 @@ sosetopt(so, sopt) * the high-water. */ case SO_SNDLOWAT: + SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_lowat = (optval > so->so_snd.sb_hiwat) ? so->so_snd.sb_hiwat : optval; + SOCKBUF_UNLOCK(&so->so_snd); break; case SO_RCVLOWAT: + SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_lowat = (optval > so->so_rcv.sb_hiwat) ? so->so_rcv.sb_hiwat : optval; + SOCKBUF_UNLOCK(&so->so_rcv); break; } break; |