diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-18 04:02:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-18 04:02:56 +0000 |
commit | 89d347105af55ef5caca90def3f20d5ad8909893 (patch) | |
tree | 5718e41dfb4dc02d3cfea1538e5a3a8ad85efed7 /sys/kern | |
parent | 8c286596fcd7a157c6f4293d10e21ced450c765f (diff) | |
download | FreeBSD-src-89d347105af55ef5caca90def3f20d5ad8909893.zip FreeBSD-src-89d347105af55ef5caca90def3f20d5ad8909893.tar.gz |
Hold SOCK_LOCK(so) while frobbing so_options. Note that while the
local race is corrected, there's still a global race in sosend()
relating to so_options and the SO_DONTROUTE flag.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 364f2db..f2f7d1d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -778,8 +778,11 @@ restart: (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, top, addr, control, td); splx(s); - if (dontroute) + if (dontroute) { + SOCK_LOCK(so); so->so_options &= ~SO_DONTROUTE; + SOCK_UNLOCK(so); + } clen = 0; control = NULL; top = NULL; |