summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
AgeCommit message (Collapse)Author
2012-02-24Correct the spelling of "transferred" and "transferring"Philip Guenthe
from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
2012-01-03When used with socket splicing, tcp_usrreq() might get called withAlexander Bluhm
a socket that has an inp but tp is NULL. The call stack for that is tcp_input() tcp_close() soisdisconnected() sorwakeup() somove() tcp_usrreq(PRU_RCVD). To avoid a NULL dereference, just return in that case. ok henning@
2011-07-06Add sysctl net.inet.tcp.always_keepalive, when this is set the systemStuart Henderson
behaves as if SO_KEEPALIVE was set on all TCP sockets, forcing keepalives to be sent every net.inet.tcp.keepidle half-seconds. In conjunction with a keepidle value greatly reduced from the default, this can be useful for keeping sessions open if you are stuck on a network with short NAT or firewall timeouts. Feedback from various people, ok henning@ claudio@
2011-04-28Make in_broadcast() rdomain aware. Mostly mechanical change.Claudio Jeker
This fixes the problem of binding sockets to broadcast IPs in other rdomains. OK henning@
2011-04-04Correctly inherit and set the watermarks on socketbuffers.Claudio Jeker
This fixes the NFS problems reported on the mailing list and ensures that accepted sockets have correct socketbuffer setting. OK blambert@, henning@
2010-10-10In tcp_update_sndspace() and tcp_update_rcvspace() change the typeAlexander Bluhm
of the variable nmax from int to u_long as the socket buffer sizes it operates on are also u_long. ok claudio@
2010-09-29Fix a unfinished comment and add another one for tcp_update_(snd|rcv)space().Claudio Jeker
Reminded by naddy@
2010-09-24TCP send and recv buffer scaling.Claudio Jeker
Send buffer is scaled by not accounting unacknowledged on the wire data against the buffer limit. Receive buffer scaling is done similar to FreeBSD -- measure the delay * bandwith product and base the buffer on that. The problem is that our RTT measurment is coarse so it overshoots on low delay links. This does not matter that much since the recvbuffer is almost always empty. Add a back pressure mechanism to control the amount of memory assigned to socketbuffers that kicks in when 80% of the cluster pool is used. Increases the download speed from 300kB/s to 4.4MB/s on ftp.eu.openbsd.org. Based on work by markus@ and djm@. OK dlg@, henning@, put it in deraadt@
2010-06-07There is no reason to allow unicast IPv4 mapped IPv6 addresses in tcpClaudio Jeker
connect() calls. Our network stack does not allow any v4 mapped addresses so there is no need to allow them in connect(). Found after discussion with Henning. OK deraadt@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2009-06-05Initial support for routing domains. This allows to bind interfaces toClaudio Jeker
alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
2008-05-24Remove {tcp/udp}6_usrreq(); Since the normal ones nowThordur I. Bjornsson
take a proc argument, theres no need for these, since they are just wrappers. OK claudio@
2008-05-23Deal with the situation when TCP nfs mounts timeout and processesThordur I. Bjornsson
get hung in nfs_reconnect() because they do not have the proper privilages to bind to a socket, by adding a struct proc * argument to sobind() (and the *_usrreq() routines, and finally in{6}_pcbbind) and do the sobind() with proc0 in nfs_connect. OK markus@, blambert@. "go ahead" deraadt@. Fixes an issue reported by bernd@ (Tested by bernd@). Fixes PR5135 too.
2008-05-15divert for ipv6; ok henning, pyrMarkus Friedl
2008-05-09divert packets to local socket without modifying the ip header;Markus Friedl
makes transparent proxies much easier; ok beck@, feedback claudio@
2007-12-13implement sysctls to report IP, TCP, UDP, and ICMP statistics andReyk Floeter
change netstat to use them instead of accessing kvm for it. more protocols will be added later. discussed with deraadt@ claudio@ gilles@ ok deraadt@
2007-11-27TCP_COMPAT_42 was last used in 1997. Kill it.Theo de Raadt
ok millert
2007-11-16in the strange/unnatural/ridiculous situation where a non-blockingTheo de Raadt
connect() which has completed and failed.. if connect() is called again.. return the so_error instead of EINVAL; from Alexey Vatchenko matches what other systems do now ok millert henning
2007-09-01since theHenning Brauer
MGET* macros were changed to function calls, there wasn't any need for the pool declarations and the inclusion of pool.h From: tbert <bret.lambert@gmail.com>
2007-06-25merge tcp_set_iss() and tcp_set_tsm(); ok mcbride, djm (on earlier version)Markus Friedl
2007-06-15Drop the current random timestamps and the current ISN generationMarkus Friedl
code and replace both with a RFC1948 based method, so TCP clients now have monotonic ISN/timestamps. The server side uses completely random ISN/timestamps and does time-wait recycling (on port reuse). ok djm@, mcbride@; thanks to lots of testers
2005-03-04- check th_ack against snd_una/max; from Raja Mukerji via hugh@Markus Friedl
- limit pool to tcp_sackhole_limit entries (sysctl-able) - stop sack option processing on pool_get errors - use SEQ_MIN/SEQ_MAX ok henning, hshoexer, deraadt
2005-02-22Move #ifdef INET6 outside of 'case AF_INET6:' in tcp_ident().Ryan Thomas McBride
No functional change due to earlier check, fix from Maxim Konovalov <maxim@macomnet.ru> ok deraadt@ dhartmei@
2004-10-28Modulate tcp_now by a random amount on a per-connection basis.Ryan Thomas McBride
ok markus@ frantzen@
2004-07-15tcp_trace() expects short, not int; ok deraadtMarkus Friedl
2004-04-27Require NULL oldp when dropping a connection.Otto Moerbeek
ok markus@
2004-04-26change tcpdrop to require newp instead of oldp; suggested by ottoMarkus Friedl
2004-04-25add TCPCTL_DROP; ok deraadt, cedric, grange, ...Markus Friedl
2004-04-12remove duplicate if. from pedro martelletto, ok markus@Ted Unangst
2004-03-02limit total number of queued out-of-order packets to NMBCLUSTERS/2; ok mcbrideMarkus Friedl
2004-02-15switch to sysctl_int_arr(); ok itojun, henning, miod, deraadtMarkus Friedl
2004-01-31rename tcp sockopt TCP_SIGNATURE_ENABLE to TCP_MD5SIGHenning Brauer
requested by theo ok markus@ hshoexer@
2004-01-31!sack_disable -> sack_enable; ok deraadt@Markus Friedl
2004-01-30add support for getsockopt(..., TCP_SIGNATURE_ENABLEHenning Brauer
so you can check wether a just accept()ed connection is md5sig'd ok deraadt@ markus@
2004-01-29support for RFC3390 (Increasing TCP's Initial Window); ok deraadt, itojunMarkus Friedl
2004-01-06import netbsd's version of David Borman's syncache codeMarkus Friedl
http://www.kohala.com/start/borman.97jun06.txt; ok deraadt@, henning@
2003-12-10de-register. deraadt okJun-ichiro itojun Hagino
2003-12-08Mbuf tag tcp and udp packets which are translated to localhost, andRyan Thomas McBride
use the the presence of this tag to reverse the match order in in{6}_pcblookup_listen(). Some daemons (such as portmap) do a double bind, binding to both * and localhost in order to differentiate local from non-local connections, and potentially granting more privilege to local ones. This change ensures that redirected connections to localhost do not appear local to such a daemon. Bulk of changes from dhartmei@, some changes markus@ ok dhartmei@ deraadt@
2003-11-04add in(6)_pcblookup_listen() and replace all calls to in_pcblookup()Markus Friedl
with either in(6)_pcbhashlookup() or in(6)_pcblookup_listen(); in_pcblookup is now only used by bind(2); speeds up pcb lookup for listening sockets; from Claudio Jeker
2003-06-09backout following:Jun-ichiro itojun Hagino
>use m_pulldown not m_pullup2. fix some bugs in IPv6 tcp_trace(). PR 3283 fixed (confirmed)
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-29use m_pulldown not m_pullup2. fix some bugs in IPv6 tcp_trace().Jun-ichiro itojun Hagino
2003-02-12Remove commons; inspired by netbsd.Jason Wright
2002-09-11KNF - return is not a function. sync w/kameJun-ichiro itojun Hagino
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-09whitespaceJun-ichiro itojun Hagino
2002-06-07avoid is_ipv6 construct. a step towards IPv4-less kernelJun-ichiro itojun Hagino
2002-05-26remove extra spaces, tabs, and semicolon.Federico G. Schwindt