summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* fix an underflow in socket timeout calculations.mickey2002-11-271-1/+3
| | | | | (see http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32827). itojun@ ok
* redo socketbuf speedup.provos2002-08-081-4/+70
|
* backout the tree break. ok pb@, art@todd2002-08-081-70/+4
|
* socket buf speedup from thorpej@netbsd, okay art@ ericj@:provos2002-08-081-4/+70
| | | | | | | | | | | | | | | | 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!
* splassert where necessaryart2002-06-111-6/+6
|
* track egid/rgid on bound/connected sockets too (pf will use this)deraadt2002-05-111-1/+3
|
* Do range check on SO_LINGER, closes pr#2375. art@ oknordin2002-02-051-2/+4
|
* Pool deals fairly well with physical memory shortage, but it doesn't dealart2002-01-231-3/+2
| | | | | | | | | | | | | | | | | | 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.
* avoid possible infinite loop in sosend() on 64bit systems. - from netbsdericj2001-11-281-12/+8
| | | | art@ ok
* change socket allocation to pool allocator; from netbsd; okay niklas@provos2001-11-271-6/+24
|
* fix an error in sosend() that could make a transient error permant.provos2001-11-271-3/+7
| | | | | | | | | | | | | | | 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).
* change socket connection queues to use TAILQ_provos2001-11-271-4/+6
| | | | | | | | 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).
* KNFderaadt2001-06-221-68/+68
|
* recover old acecept(2) behavior (no ECONNABORTED) for unix domain socket.itojun2001-05-251-2/+3
| | | | | it is to be friendly with postfix daemon-to-daemon communication (not 100% sure if which behavior is correct, specwise). patch similar to netbsd.
* different fix, we still need to deliver EV_EOF; from jlemon@freebsd.orgprovos2001-03-061-4/+6
|
* fix a kqueue related panic triggered by shutdown, okay art@provos2001-03-061-1/+4
|
* port kqueue changes from freebsd, plus all required openbsd glue.provos2001-03-011-26/+34
| | | | | | | okay deraadt@, millert@ from jlemon@freebsd.org: extend kqueue down to the device layer, backwards compatible approach suggested by peter@freebsd.org
* return ECONNABORTED, if the socket (tcp connection for example)itojun2001-02-071-2/+2
| | | | | | 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.
* when the peer is disconnected before accept(2) is issued,itojun2001-01-231-1/+3
| | | | | | | | 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).
* support kernel event queues, from FreeBSD by Jonathan Lemon,provos2000-11-161-1/+113
| | | | okay art@, millert@
* Fix for PR 871.cmetz1999-10-141-6/+16
| | | | | | | | | | | | | | | | | | | | 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.
* fixed patch for accept/select race; mycroft@netbsd.orgmillert1999-02-191-10/+21
|
* undo select/accept patch, which causes full listen queues apparentlyderaadt1999-02-181-20/+13
|
* support MSG_BCAST and MSG_MCASTderaadt1999-02-051-3/+6
|
* Fixes select(2)/accept(2) race condition which permits DoS; mycroft@netbsd.orgmillert1999-01-211-13/+20
|
* Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (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 * ↵millert1998-07-281-4/+5
| | | | as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more
* add seperate so_euid & so_ruid to struct socket, so that identd is still fast.. Sigh. I will change this again laterderaadt1998-02-141-2/+3
|
* so_linger is in secondsderaadt1998-01-061-3/+3
|
* for shutdown(2), if "how" is not 0-2, return EINVALderaadt1997-11-151-1/+3
|
* MSG_EOR on SOCK_STREAM is invalid; wollmanderaadt1997-11-111-2/+4
|
* for non-tty TIOCSPGRP/F_SETOWN/FIOSETOWN pgid setting calls, store uidderaadt1997-08-311-7/+2
| | | | | | | 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.
* mbuf leak repair; mycroft@netbsdderaadt1997-08-311-3/+5
|
* constrain lowwater >= highwaterderaadt1997-06-291-3/+5
|
* oopsderaadt1997-06-231-2/+2
|
* for SO_SND*/SO_RCV*, clip low-end of parameter to 1deraadt1997-06-231-4/+11
|
* SO_SNDTIMEO tv_usec calc error; stevens, vol2, p548deraadt1997-06-061-2/+2
|
* Moved IPsec socket state to the PCB.angelos1997-02-281-11/+1
|
* New variables for system-wide security default levels.angelos1997-02-281-4/+9
|
* IPsec socket API additions.angelos1997-02-281-1/+7
|
* uiomove not checked for failure; wpaul@skynet.ctr.columbia.eduderaadt1996-12-161-1/+3
|
* `solve' the syn bomb problem as well as currently known; add sysctl's forderaadt1996-09-201-4/+12
| | | | | | 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.
* change to so_uid, also fix a missing credential found by dmderaadt1996-08-241-4/+2
|
* incorrect size calculation in mbuf copying, netbsd pr#2692; fix from explorer@flame.orgderaadt1996-08-141-2/+2
|
* struct socket gets so_ucred; permit only same uid or root to do port takeover.deraadt1996-08-051-1/+4
|
* From NetBSD: 960217 mergeniklas1996-03-031-43/+38
|
* from NetBSD: so it compiles now again ;)mickey1996-03-031-1/+1
|
* initial import of NetBSD treederaadt1995-10-181-0/+1052