freebsd-nq/lib
John Polstra e2e3d0a401 For the TCP transport, put the listening socket in non-blocking
mode.  This addresses a well-known race condition that can cause
servers to hang in accept().  The relevant case is when somebody
connects to the server and then immediately kills the connection
by sending a TCP reset.  On the server this causes select to report
a ready condition on the socket, after which the accept call blocks
because there is no longer any pending connection to accept.

In -current there is already a work-around for this in the kernel.
It was merged into -stable some time ago, but then David Greenman
reverted it because it seemed to be causing a socket leak in some
cases.  (See uipc_socket.c revision 1.51.2.3.)  Hence this userland
fix is needed in -stable, and I plan to merge it into that branch
soon because it fixes a potential DoS attack.  It may also be needed
in -current if the suspected socket leak turns out to be real.  In
any case, after thinking it over I believe the fix belongs in
userland.  An application shouldn't assume that a ready return from
select guarantees that the subsequent I/O operation cannot block.
A lot can happen between the select and the accept.

A similar fix should most likely be applied to the Unix domain
socket transport too.

Submitted by:	peter
Reviewed by:	jdp
1999-11-18 03:01:06 +00:00
..
compat Add $FreeBSD$ - not that it makes much difference, but this is mainly meant 1999-10-29 01:20:50 +00:00
csu
libalias Restore sub-chapters order. 1999-11-09 00:24:09 +00:00
libatm
libbind
libc For the TCP transport, put the listening socket in non-blocking 1999-11-18 03:01:06 +00:00
libc_r Add sigsuspend.o and sigpending.o to HIDDEN_SYSCALLS as well. 1999-10-14 10:08:53 +00:00
libcalendar
libcam Fix a file descriptor leak in cam_open_btl(). The xpt device was opened, 1999-09-12 19:40:20 +00:00
libcom_err Zap $Source$ 1999-09-06 07:41:34 +00:00
libcompat
libcrypt Never return NULL, always return a hash. 1999-09-22 06:53:08 +00:00
libcurses
libdevstat Clarify what getdevs() expects as input. 1999-09-23 06:36:02 +00:00
libdisk Teach libdisk about the AMI and Mylex RAID drivers. You should be able 1999-11-02 03:40:14 +00:00
libedit Fix style bugs 1999-10-03 10:41:40 +00:00
libfetch
libform Add bmake glue for libform (the SVSV-style ETI curses form driver from 1999-09-05 05:37:49 +00:00
libftpio Fix style bugs and ordering 1999-10-03 10:40:11 +00:00
libgnumalloc
libio
libipx
libkse Add sigsuspend.o and sigpending.o to HIDDEN_SYSCALLS as well. 1999-10-14 10:08:53 +00:00
libkvm Introduce commandline caching in the kernel. 1999-11-16 20:31:58 +00:00
libm ${MACHINE} -> ${MACHINE_ARCH} 1999-11-14 13:54:44 +00:00
libmd
libmenu
libmytinfo Fix termcap % code processing for some terminals. 1999-10-20 08:52:09 +00:00
libncp Repo copy ncp_cfg.h ncp_lib.h ncp_file.h ncp_rcfile.h from here to 1999-11-12 15:09:58 +00:00
libncurses Don't complain loudly about unknown termcap capabilities, eg: 1999-11-17 01:01:02 +00:00
libnetgraph Whistle's Netgraph link-layer (sometimes more) networking infrastructure. 1999-10-21 09:06:11 +00:00
libopie
libpam Don't include Kerberos if NOCRYPT is defined, because it isn't build 1999-11-14 15:48:29 +00:00
libpanel Add bmake glue for libpanel (the SVSV-style ETI curses panel (overlapping 1999-09-05 05:36:12 +00:00
libpcap
libpthread Add sigsuspend.o and sigpending.o to HIDDEN_SYSCALLS as well. 1999-10-14 10:08:53 +00:00
libradius Add support for RADIUS accounting. Note, this changes the format 1999-10-31 04:47:59 +00:00
libresolv
librpcsvc
libskey
libss sigset_t change (part 5 of 5) 1999-09-29 15:18:46 +00:00
libstand Change toupper/tolower so that they don't give a bogus answer if the 1999-09-11 17:54:37 +00:00
libtacplus
libtelnet
libtermcap Explicitly use sigemptyset to clear a sigset_t. Explicit 1999-09-28 13:43:21 +00:00
libutil Make setproctitle(NULL) restore all of the original arguments 1999-11-17 21:12:17 +00:00
libvgl Fix the VGLBITMAP_INITIALIZER macro; VXsize and VYsize should 1999-11-09 12:11:24 +00:00
libwrap
libxpg4
liby
libz Hard-configure z_off_t as long. Soft configuration using HAVE_UNISTD_H 1999-10-09 11:31:50 +00:00
msun style fix 1999-11-09 00:18:22 +00:00
ncurses Don't complain loudly about unknown termcap capabilities, eg: 1999-11-17 01:01:02 +00:00
Makefile Whistle's Netgraph link-layer (sometimes more) networking infrastructure. 1999-10-21 09:06:11 +00:00
Makefile.inc