summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timer.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Accept reject and blackhole routes for IPsec PMTU discovery.bluhm2020-12-201-2/+2
| | | | | | | | | | | | | | | Since revision 1.87 of ip_icmp.c icmp_mtudisc_clone() ignored reject routes. Otherwise TCP would clone these routes for PMTU discovery. They will not work, even after dynamic routing has found a better route than the reject route. With IPsec the use case is different. First you need a route, but then the flow handles the packet without routing. Usually this route should be a reject route to avoid sending unencrypted traffic if the flow is missing. But IPsec needs this route for PMTU discovery, so use it for that. OK claudio@ tobhe@
* The output from tcp debug sockets was incomplete. After detach tpbluhm2018-06-111-21/+36
| | | | | | | | was NULL and nothing was traced. So save the old tcpcb and use that to retrieve some information. Note that otb may be freed and must not be dereferenced. Use a heuristic for cases where the address family is in the IP header but not provided in the PCB. OK visa@
* TCP debug sockets still had code for old TCP timers that werebluhm2018-05-101-3/+23
| | | | | | implemented as slow and fast protocol user requests. Replace that with a proper timer debug implementation. OK visa@
* Historically there were slow and fast tcp timeouts. That is whybluhm2018-05-081-3/+9
| | | | | | the delack timer had a different implementation. Use the same mechanism for all TCP timer. OK mpi@ visa@
* Historically TCP timeouts were implemented with pr_slowtimo andbluhm2018-02-071-4/+4
| | | | | | | | pr_fasttimo. That is the reason why we have two timeout mechanisms with complicated ticks calculation. Move the delay ACK timeout to milliseconds and remove some ticks and hz mess from the others. This makes it easier to see the actual values. OK florian@ dhill@ dlg@
* There was a race in the TCP timers. As they may sleep to grab thebluhm2018-02-061-7/+20
| | | | | | | | | | | netlock, timers may still run after they have been disarmed. Deleting the timeout is not sufficient to cancel them, but the code from 4.4 BSD is assuming this. The solution is to add a flag for every timer to see whether it has been armed or canceled. Remove the TF_DEAD check as tcp_canceltimers() is called before the reaper timer is fired. Cancelation works reliably now. OK mpi@
* The TCP reaper timeout was still imlemented as soft timeout. Sobluhm2018-01-231-1/+20
| | | | | | | | | | | it could run immediately and was not synchronized with the TCP timeouts, although that was the intension when it was introduced in revision 1.85. Convert the reaper to an ordinary TCP timeout so it is scheduled on the same timeout thread after all timeouts have finished. A net lock is not necessary as the process calling tcp_close() will not access the tcpcb after arming the reaper timeout. OK mikeb@
* Although it is a dead store here, always reassign the tcpcb afterbluhm2018-01-231-2/+2
| | | | | | calling tcp_close(), tcp_drop(), and tcp_disconnect(). Then no freed memory can be used after closing a TCP connection. OK mikeb@ mpi@
* Move NET_{,UN}LOCK into individual slowtimo functions.florian2017-10-291-2/+4
| | | | | | Direction suggested by mpi OK mpi, visa
* Remove the TCP_FACK option and associated #if{,n}def code.job2017-10-251-6/+1
| | | | | | | | | TCP_FACK was disabled by provos@ in June 1999. TCP_FACK is an algorithm that decides that when something is lost, all not SACKed packets until the most forward SACK are lost. It may be a correct estimate, if network does not reorder packets. OK visa@ mpi@ mikeb@
* Unconditionally enable TCP selective acknowledgements (SACK)mikeb2017-10-221-10/+2
| | | | OK deraadt, mpi, visa, job
* Remove NET_LOCK()'s argument.mpi2017-08-111-17/+12
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().mpi2017-05-161-2/+2
| | | | ok visa@
* Use the rt_rmx defines that hide the struct rt_kmetrics indirection.bluhm2017-04-191-4/+4
| | | | | No binary change. OK mpi@
* percpu counters for TCP statsjca2017-02-091-9/+9
| | | | ok mpi@ bluhm@
* Introduce the NET_LOCK() a rwlock used to serialize accesses to the partsmpi2016-12-191-12/+12
| | | | | | | | | | | of the network stack that are not yet ready to be executed in parallel or where new sleeping points are not possible. This first pass replace all the entry points leading to ip_output(). This is done to not introduce new sleeping points when trying to acquire ART's write lock, needed when a new L2 entry is created via the RT_RESOLVE. Inputs from and ok bluhm@, ok dlg@
* Assert that every slow/fast timeout routine is called at IPL_SOFTNET.mpi2016-11-281-4/+2
| | | | This removes multipe recursive splsoftnet()/splx() dances.
* Use goto for consistently instead of splx() and return.mpi2016-11-071-24/+14
| | | | This will allow to have a single lock/unlock dance per timer.
* ANSIfy netinet/; from David Hillnaddy2016-09-241-3/+2
|
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-2/+2
| | | | ok mpi@ millert@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Change MTU discovery functions to not abuse the global icmpsrc variablempi2013-08-081-10/+9
| | | | | | to pass the destination address of the route to clone. ok markus@, mikeb@
* Add sysctl net.inet.tcp.always_keepalive, when this is set the systemsthen2011-07-061-2/+4
| | | | | | | | | | | 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@
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-4/+4
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* Extend the protosw pr_ctlinput function to include the rdomain. This isclaudio2009-11-131-4/+4
| | | | | | | | needed so that the route and inp lookups done in TCP and UDP know where to look. Additionally in_pcbnotifyall() and tcp_respond() got a rdomain argument as well for similar reasons. With this tcp seems to be now fully rdomain save and no longer leaks single packets into the main domain. Looks good markus@, henning@
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-3/+4
| | | | | | | | | 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@
* when creating a response, use the correct TCP header instead ofmarkus2008-02-201-2/+2
| | | | relying on the mbuf chain layout; with claudio@ and krw@; ok henning@
* TCP_COMPAT_42 was last used in 1997. Kill it.deraadt2007-11-271-16/+1
| | | | ok millert
* since thehenning2007-09-011-1/+2
| | | | | | 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>
* Drop the current random timestamps and the current ISN generationmarkus2007-06-151-1/+3
| | | | | | | 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
* Only two `h' in threshold.miod2005-11-151-4/+4
|
* implement PMTU checks frommarkus2005-06-301-1/+27
| | | | | | | http://www.gont.com.ar/drafts/icmp-attacks-against-tcp.html i.e. don't act on ICMP-need-frag immediately if adhoc checks on the advertised mtu fail. the mtu update is delayed until a tcp retransmit happens. initial patch by Fernando Gont, tested by many.
* zap lvalue assignment, okay markus@. approved miod@espie2004-12-131-2/+2
|
* fix for race between invocation for timer and network inputmarkus2004-11-251-1/+22
| | | | | | 1) add a reaper for TCP and SYN cache states (cf. netbsd pr 20390) 2) additional check for TCP_TIMER_ISARMED(TCPT_REXMT) in tcp_timer_persist() with mickey@; ok deraadt@
* de-register. deraadt okitojun2003-12-101-2/+2
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* remove useless assignmenttedu2003-02-211-2/+2
| | | | ok jason@
* fix ecn breakage.kjc2002-11-061-1/+10
| | | | | | | | this part of falling back to non-ecn on timeout slipped during merge from KAME. ok @art report to bugs@ by Han Boetes and Otto Moerbeek
* whitespaceitojun2002-06-091-3/+3
|
* bring in ECN support from KAME.kjc2002-05-161-1/+8
| | | | | | | | | | | | it consists of - ECN support in TCP - tunnel-egress and fragment reassembly rules in layer-3 not to lose congestion info at tunnel-egress and fragment reassembly to enable ECN in TCP, build a kernel with TCP_ECN, and then, turn it on by "sysctl -w net.inet.tcp.ecn=1". ok deraadt@
* use timeout(9) to schedule TCP timers. this avoid traversing allprovos2002-03-081-266/+262
| | | | tcp connections during tcp_slowtimo. apdapted from thorpej@netbsd.org
* remove tcp_fasttimo and convert delayed acks to the timeout(9) API instead.provos2002-03-011-22/+43
| | | | adapated from netbsd. okay angelos@
* allocate sackholes with poolprovos2002-01-151-2/+2
|
* knfprovos2002-01-141-6/+6
|
* use macros to manage tcp timers; based on netbsdprovos2002-01-141-6/+6
|
* at least ; required after label or case; openbsd@davidkrause.comderaadt2002-01-021-1/+2
|
* Cut down on include files.angelos2001-06-081-7/+1
|
* Two fixes from Stevens via davidg@freebsd, bug report byprovos2001-05-311-2/+2
| | | | | | | | | | armin@wolfermann.org - set the persist timer so that connections in CLOSING state timeout - honor keep-alive timer in CLOSING state. Fixes the problem in simulaneous close situation where connections would never leave the CLOSING state and stay arround indefinitly.
* more random tcp sequence numbers. okay deraadt@, angelos@provos2000-12-131-4/+2
|
* only disable path mtu for established connections that have data to send.provos2000-12-121-1/+5
|