summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket2.c
Commit message (Collapse)AuthorAgeFilesLines
* sonewconn no longer passes curproc to the protocol attach methodtegge1997-09-041-2/+2
| | | | | | since that might cause in_pcballoc to call MALLOC with M_WAITOK during a software interrupt. Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Removed unused #includes.bde1997-09-021-3/+1
|
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-161-144/+21
| | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
* Remove sonewconn() macro kludge, introduced in 4.3-Reno to catch argumentfenner1997-07-191-5/+2
| | | | | | mismatches. Prototypes do a much better job these days. Noticed by: bde
* Attempt to convert the ip_divert code to use the new-style protocol requestpeter1997-05-241-1/+7
| | | | | | switch. I needed 'LINT' to compile for other reasons so I kinda got the blood on my hands. Note: I don't know how to test this, I don't know if it works correctly.
* The long-awaited mega-massive-network-code- cleanup. Part I.wollman1997-04-271-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out.
* In accept1(), falloc() is called after the process has awoken, but priordg1997-03-311-3/+3
| | | | | | | | | | | to removing the connection from the queue. The problem here is that falloc() may block and this would allow another process to accept the connection instead. If this happens to leave the queue empty, then the system will panic with an "accept: nothing queued". Also changed a wakeup() to a wakeup_one() to avoid the "thundering herd" problem on new connections in Apache (or any other application that has multiple processes blocked in accept() for the same socket).
* Create a new branch of the kernel MIB, kern.ipc, to storewollman1997-02-241-4/+15
| | | | | | | | | | | all of the configurables and instrumentation related to inter-process communication mechanisms. Some variables, like mbuf statistics, are instrumented here for the first time. For mbuf statistics: also keep track of m_copym() and m_pullup() failures, and provide for the user's inspection the compiled-in values of MSIZE, MHLEN, MCLBYTES, and MINCLSIZE.
* Make the operation of sonewconn1() a bit clearer by callingwollman1997-02-191-12/+7
| | | | | pru_attach() before putting the new connection on the connection queue.
* uipc_mbuf.c: do a better job of counting how often we have to waitwollman1997-02-181-0/+35
| | | | | | | for memory, or are denied a cluster. uipc_socket2.c: define some generic ``operation-not-supported'' entry points for pr_usrreqs.
* For large values of sb_max or MCLBYTES, it was possible for the expressionwollman1997-02-131-2/+1
| | | | | | | sb_max * MCLBYTES / (MSIZE + MCLBYTES) used in sbreserve() to overflow, causing all socket creation attempts to fail. Force the calculation to use u_quad_t's, which makes overflow less likely.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Add the IP_RECVIF socket option, which supplies a packet's incoming interfacefenner1996-11-111-1/+27
| | | | | | | | using a sockaddr_dl. Fix the other packet-information socket options (SO_TIMESTAMP, IP_RECVDSTADDR) to work for multicast UDP and raw sockets as well. (They previously only worked for unicast UDP).
* Fix two bugs I accidently put into the syn code at the last minutepst1996-10-111-9/+11
| | | | | | | | | | (yes I had tested the hell out of this). I've also temporarily disabled the code so that it behaves as it previously did (tail drop's the syns) pending discussion with fenner about some socket state flags that I don't fully understand. Submitted by: fenner
* Increase robustness of FreeBSD against high-rate connection attemptpst1996-10-071-6/+46
| | | | | | | denial of service attacks. Reviewed by: bde,wollman,olah Inspired by: vjs@sgi.com
* Add a new sysctl variable kern.sominqueue to override the MINIMUM queuepst1996-09-191-2/+6
| | | | specified in a listen(2) system call.
* for kern_conf.c, start allocating dynamic major numbersjulian1996-08-191-2/+2
| | | | | | | | | half way through the range rather than possibly colliding with fixed elements. Increase the size of the arrays to take this into account.. remember that each element in the array is now only 1 ponter so this isn't that much.. also note a possible bug in debugging code in uipc_socket2.c (add XXX)
* Modify the kernel to use the new pr_usrreqs interface rather than the oldwollman1996-07-111-95/+27
| | | | | | | | | | | | | | pr_usrreq mechanism which was poorly designed and error-prone. This commit renames pr_usrreq to pr_ousrreq so that old code which depended on it would break in an obvious manner. This commit also implements the new interface for TCP, although the old function is left as an example (#ifdef'ed out). This commit ALSO fixes a longstanding bug in the TCP timer processing (introduced by davidg on 1995/04/12) which caused timer processing on a TCB to always stop after a single timer had expired (because it misinterpreted the return value from tcp_usrreq() to indicate that the TCB had been deleted). Finally, some code related to polling has been deleted from if.c because it is not relevant t -current and doesn't look at all like my current code.
* This is a proposal-in-code for a substantial modification of the waywollman1996-07-091-1/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the high kernel calls into a protocol stack to perform requests on the user's behalf. We replace the pr_usrreq() entry in struct protosw with a pointer to a structure containing pointers to functions which implement the various reuqests; each function is declared with the correct type and number of arguments. (This is unlike the current scheme in which a quarter of the requests take arguments of type other than (struct mbuf *) and the difference is papered over with casts.) There are a few benefits to this new scheme: 1) Arguments are passed with their correct types, and null-pointer dummies are no longer necessary. 2) There should be slightly better caching effects from eliminating the prximity to extraneous code and th switch in pr_usrreq(). 3) It becomes much easier to change the types of the arguments to something other than `struct mbuf *' (e.g.,pushing the work of sosend() into the protocol as advocated by Van Jacobson). There is one principal drawback: existing protocol stacks need to be modified. This is alleviated by compatibility code in uipc_socket2.c and uipc_domain.c which emulates the new interface in terms of the old and vice versa. This idea is not original to me. I read about what Jacobson did in one of his papers and have tried to implement the first steps towards something like that here. Much work remains to be done.
* Clean up -Wunused warnings.gpalmer1996-06-121-2/+1
| | | | Reviewed by: bde
* Changed socket code to use 4.4BSD queue macros. This includes removingdg1996-03-111-57/+22
| | | | | | | | | the obsolete soqinsque and soqremque functions as well as collapsing so_q0len and so_qlen into a single queue length of unaccepted connections. Now the queue of unaccepted & complete connections is checked directly for queued sockets. The new code should be functionally equivilent to the old while being substantially faster - especially in cases where large numbers of connections are often queued for accept (e.g. http).
* Eliminate the dramatic TCP performance decrease observed for writes inwollman1996-01-051-2/+6
| | | | | | | | | | | | | | | | | the range [210:260] by sweeping the problem under the rug. This change has the following effects: 1) A new MIB variable in the kern branch is defined to allow modification of the socket buffer layer's ``wastage factor'' (which determines how much unused-but-allocated space in mbufs and mbuf clusters is allowed in a socket buffer). 2) The default value of the wastage factor is changed from 2 to 8. The original value was chosen when MINCLSIZE was 7*MLEN (!), and is not appropriate for an environment where MINCLSIZE is much less. The real solution to this problem is to scrap both mbufs and sockbufs and completely redesign the buffering mechanism used at both levels.
* Nuked ambiguous sleep message strings:bde1995-12-141-8/+3
| | | | | | | old: new: netcls[] = "netcls" "soclos" netcon[] = "netcon" "accept", "connec" netio[] = "netio" "sblock", "sbwait"
* Make somaxconn (maximum backlog in a listen(2) request) and sb_maxwollman1995-11-031-2/+5
| | | | | | | | (maximum size of a socket buffer) tunable. Permit callers of listen(2) to specify a negative backlog, which is translated into somaxconn. Previously, a negative backlog was silently translated into 0.
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
|
* All of this is cosmetic. prototypes, #includes, printfs and so on. Makesphk1994-10-021-18/+20
| | | | GCC a lot more silent.
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-0/+32
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+755
OpenPOWER on IntegriCloud