diff options
author | fenner <fenner@FreeBSD.org> | 1999-01-25 16:58:56 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1999-01-25 16:58:56 +0000 |
commit | 56bddd51c28ba7ae74608ff9e0278bf9b2ac4ad4 (patch) | |
tree | 34acae73d887557e2b1596dd39b6b88ad399a920 /sys/kern/uipc_sockbuf.c | |
parent | 479ab8882bc874ce42a63facf700e543ee0dd470 (diff) | |
download | FreeBSD-src-56bddd51c28ba7ae74608ff9e0278bf9b2ac4ad4.zip FreeBSD-src-56bddd51c28ba7ae74608ff9e0278bf9b2ac4ad4.tar.gz |
Port NetBSD's 19990120-accept bug fix. This works around the race condition
where select(2) can return that a listening socket has a connected socket
queued, the connection is broken, and the user calls accept(2), which then
blocks because there are no connections queued.
Reviewed by: wollman
Obtained from: NetBSD
(ftp://ftp.NetBSD.ORG/pub/NetBSD/misc/security/patches/19990120-accept)
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index e718c62..e885fce 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.42 1998/11/23 00:45:38 truckman Exp $ + * $Id: uipc_socket2.c,v 1.43 1998/12/07 21:58:29 archie Exp $ */ #include <sys/param.h> @@ -136,7 +136,7 @@ soisdisconnected(so) { so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); - so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE); + so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE|SS_ISDISCONNECTED); wakeup((caddr_t)&so->so_timeo); sowwakeup(so); sorwakeup(so); |