summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket.c
AgeCommit message (Collapse)Author
2003-02-03knfTheo de Raadt
2002-11-27Avoid possible wraparound when checking timeout size; mickey@ OKTodd C. Miller
2002-11-27fix an underflow in socket timeout calculations.Michael Shalayeff
(see http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32827). itojun@ ok
2002-08-08redo socketbuf speedup.Niels Provos
2002-08-08backout the tree break. ok pb@, art@Todd T. Fries
2002-08-08socket buf speedup from thorpej@netbsd, okay art@ ericj@:Niels Provos
Make insertion of data into socket buffers O(C): * Keep pointers to the first and last mbufs of the last record in the socket buffer. * Use the sb_lastrecord pointer in the sbappend*() family of functions to avoid traversing the packet chain to find the last record. * Add a new sbappend_stream() function for stream protocols which guarantee that there will never be more than one record in the socket buffer. This function uses the sb_mbtail pointer to perform the data insertion. Make TCP use sbappend_stream(). On a profiling run, this makes sbappend of a TCP transmission using a 1M socket buffer go from 50% of the time to .02% of the time. Thanks to Bill Sommerfeld and YAMAMOTO Takashi for their debugging assistance!
2002-06-11splassert where necessaryArtur Grabowski
2002-05-11track egid/rgid on bound/connected sockets too (pf will use this)Theo de Raadt
2002-02-05Do range check on SO_LINGER, closes pr#2375. art@ okThomas Nordin
2002-01-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2001-11-28avoid possible infinite loop in sosend() on 64bit systems. - from netbsdEric Jackson
art@ ok
2001-11-27change socket allocation to pool allocator; from netbsd; okay niklas@Niels Provos
2001-11-27fix an error in sosend() that could make a transient error permant.Niels Provos
verified with both netbsd and freebsd. from netbsd: Tue Jun 8 02:39:57 1999 UTC by thorpej In sosend(), if so_error is set, clear it before returning the error to the process (i.e. pre-Reno behavior). The 4.4BSD behavior (introduced in Reno) caused transient errors to stick incorrectly. This is from PR #7640 (Havard Eidnes), cross-checked w/ FreeBSD, where Bill Fenner committed the same fix (as described in a comment in the Vat sources, by Van Jacobsen).
2001-11-27change socket connection queues to use TAILQ_Niels Provos
from NetBSD: Wed Jan 7 23:47:08 1998 UTC by thorpej Make insertion and removal of sockets from the partial and incoming connections queues O(C) rather than O(N).
2001-06-22KNFTheo de Raadt
2001-05-25recover old acecept(2) behavior (no ECONNABORTED) for unix domain socket.Jun-ichiro itojun Hagino
it is to be friendly with postfix daemon-to-daemon communication (not 100% sure if which behavior is correct, specwise). patch similar to netbsd.
2001-03-06different fix, we still need to deliver EV_EOF; from jlemon@freebsd.orgNiels Provos
2001-03-06fix a kqueue related panic triggered by shutdown, okay art@Niels Provos
2001-03-01port kqueue changes from freebsd, plus all required openbsd glue.Niels Provos
okay deraadt@, millert@ from jlemon@freebsd.org: extend kqueue down to the device layer, backwards compatible approach suggested by peter@freebsd.org
2001-02-07return ECONNABORTED, if the socket (tcp connection for example)Jun-ichiro itojun Hagino
is disconnected by RST right before accept(2). fixes NetBSD PR 10698/12027. checked with SUSv2, XNET 5.2, and Stevens (unix network programming vol 1 2nd ed) section 5.11.
2001-01-23when the peer is disconnected before accept(2) is issued,Jun-ichiro itojun Hagino
do not return junk data in mbuf (= sockaddr on accept(2)'s 2nd arg). set the length to zero. behavior checked with bsdi and freebsd. partial solution to NetBSD PR 12027 and 10698 (need more investigation).
2000-11-16support kernel event queues, from FreeBSD by Jonathan Lemon,Niels Provos
okay art@, millert@
1999-10-14Fix for PR 871.cmetz
This fix is taken from BSD/OS (the file in question being BSD licensed). It continues to remove a datagram from a socket receive buffer even if there is an error on the copy-out, so as to leave the buffer in a reasonable state. Before, the kernel would stop in mid-receive if the copy-out failed, and the buffer's structural requirements would be violated (since the start of a datagram must be an address iff ). Note that if the user provides any invalid addresses as arguments to a recvmsg(), the datagram at the front of the buffer will be discarded. The more correct behavior would be not to remove this datagram if the arguments are invalid. Implementing this behavior requires a lot of significant changes, and socket receives are a critical path. Also included are two simple and fairly obvious fixes from the same source. If non-blocking I/O is set, it makes sure the receieve is non-blocking. It also fixes a slightly over-aggressive optimization.
1999-02-19fixed patch for accept/select race; mycroft@netbsd.orgTodd C. Miller
1999-02-18undo select/accept patch, which causes full listen queues apparentlyTheo de Raadt
1999-02-05support MSG_BCAST and MSG_MCASTTheo de Raadt
1999-01-21Fixes select(2)/accept(2) race condition which permits DoS; mycroft@netbsd.orgTodd C. Miller
1998-07-28Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned ↵Todd C. Miller
(size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more
1998-02-14add seperate so_euid & so_ruid to struct socket, so that identd is still ↵Theo de Raadt
fast.. Sigh. I will change this again later
1998-01-06so_linger is in secondsTheo de Raadt
1997-11-15for shutdown(2), if "how" is not 0-2, return EINVALTheo de Raadt
1997-11-11MSG_EOR on SOCK_STREAM is invalid; wollmanTheo de Raadt
1997-08-31for non-tty TIOCSPGRP/F_SETOWN/FIOSETOWN pgid setting calls, store uidTheo de Raadt
and euid as well, then deliver them using new csignal() interface which ensures that pgid setting process is permitted to signal the pgid process(es). Thanks to newsham@aloha.net for extensive help and discussion.
1997-08-31mbuf leak repair; mycroft@netbsdTheo de Raadt
1997-06-29constrain lowwater >= highwaterTheo de Raadt
1997-06-23oopsTheo de Raadt
1997-06-23for SO_SND*/SO_RCV*, clip low-end of parameter to 1Theo de Raadt
1997-06-06SO_SNDTIMEO tv_usec calc error; stevens, vol2, p548Theo de Raadt
1997-02-28Moved IPsec socket state to the PCB.Angelos D. Keromytis
1997-02-28New variables for system-wide security default levels.Angelos D. Keromytis
1997-02-28IPsec socket API additions.Angelos D. Keromytis
1996-12-16uiomove not checked for failure; wpaul@skynet.ctr.columbia.eduTheo de Raadt
1996-09-20`solve' the syn bomb problem as well as currently known; add sysctl's forTheo de Raadt
SOMAXCONN (kern.somaxconn), SOMINCONN (kern.sominconn), and TCPTV_KEEP_INIT (net.inet.tcp.keepinittime). when this is not enough (ie. overfull), start doing tail drop, but slightly prefer the same port.
1996-08-24change to so_uid, also fix a missing credential found by dmTheo de Raadt
1996-08-14incorrect size calculation in mbuf copying, netbsd pr#2692; fix from ↵Theo de Raadt
explorer@flame.org
1996-08-05struct socket gets so_ucred; permit only same uid or root to do port takeover.Theo de Raadt
1996-03-03From NetBSD: 960217 mergeNiklas Hallqvist
1996-03-03from NetBSD: so it compiles now again ;)Michael Shalayeff
1995-10-18initial import of NetBSD treeTheo de Raadt