diff options
author | maxim <maxim@FreeBSD.org> | 2006-05-21 19:28:46 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-05-21 19:28:46 +0000 |
commit | fa6b08051c710322e2dbdb6f59f74414d771b5b3 (patch) | |
tree | 82418f9db4e13c7dac2b40f76b3a57b0d4e03779 /sys/netinet/raw_ip.c | |
parent | 2be20d920e7d20ca9ca90bce5b88693a2cfa576d (diff) | |
download | FreeBSD-src-fa6b08051c710322e2dbdb6f59f74414d771b5b3.zip FreeBSD-src-fa6b08051c710322e2dbdb6f59f74414d771b5b3.tar.gz |
o In udp|rip_disconnect() acquire a socket lock before the socket
state modification. To prevent races do that while holding inpcb
lock.
Reviewed by: rwatson
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 63a6245..b311c74 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -671,9 +671,11 @@ rip_disconnect(struct socket *so) INP_INFO_WLOCK(&ripcbinfo); INP_LOCK(inp); inp->inp_faddr.s_addr = INADDR_ANY; + SOCK_LOCK(so); + so->so_state &= ~SS_ISCONNECTED; + SOCK_UNLOCK(so); INP_UNLOCK(inp); INP_INFO_WUNLOCK(&ripcbinfo); - so->so_state &= ~SS_ISCONNECTED; return (0); } |