summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_output.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate the allocation of a tcp template structure for eachMike Silbersack2001-06-231-10/+2
| | | | | | | | | | | | | | | connection. The information contained in a tcptemp can be reconstructed from a tcpcb when needed. Previously, tcp templates required the allocation of one mbuf per connection. On large systems, this change should free up a large number of mbufs. Reviewed by: bmilekic, jlemon, ru MFC after: 2 weeks Notes: svn path=/head/; revision=78642
* Sync with recent KAME.Hajimu UMEMOTO2001-06-111-2/+6
| | | | | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks Notes: svn path=/head/; revision=78064
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-2/+4
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Convert all users of fldoff() to offsetof(). fldoff() is badPoul-Henning Kamp2000-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde Notes: svn path=/head/; revision=67708
* Don't do snd_nxt rollback optimization (rev. 1.46) for SYN packets.Archie Cobbs2000-09-111-3/+2
| | | | | | | | | | | It causes a panic when/if snd_una is incremented elsewhere (this is a conservative change, because originally no rollback occurred for any packets at all). Submitted by: Vivek Sadananda Pai <vivek@imimic.com> Notes: svn path=/head/; revision=65751
* Improve performance in the case where ip_output() returns an error.Archie Cobbs2000-08-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When this happens, we know for sure that the packet data was not received by the peer. Therefore, back out any advancing of the transmit sequence number so that we send the same data the next time we transmit a packet, avoiding a guaranteed missed packet and its resulting TCP transmit slowdown. In most systems ip_output() probably never returns an error, and so this problem is never seen. However, it is more likely to occur with device drivers having short output queues (causing ENOBUFS to be returned when they are full), not to mention low memory situations. Moreover, because of this problem writers of slow devices were required to make an unfortunate choice between (a) having a relatively short output queue (with low latency but low TCP bandwidth because of this problem) or (b) a long output queue (with high latency and high TCP bandwidth). In my particular application (ISDN) it took an output queue equal to ~5 seconds of transmission to avoid ENOBUFS. A more reasonable output queue of 0.5 seconds resulted in only about 50% TCP throughput. With this patch full throughput was restored in the latter case. Reviewed by: freebsd-net Notes: svn path=/head/; revision=64213
* re-enable the tcp newreno code.Jayanth Vijayaraghavan2000-07-121-1/+1
| | | | Notes: svn path=/head/; revision=63048
* sync with kame tree as of july00. tons of bug fixes/improvements.Jun-ichiro itojun Hagino2000-07-041-17/+24
| | | | | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change) Notes: svn path=/head/; revision=62587
* When attempting to transmit a packet, if the system fails to allocateJonathan Lemon2000-06-021-0/+4
| | | | | | | | | | | | | | | | a mbuf, it may return without setting any timers. If no more data is scheduled to be transmitted (this was a FIN) the system will sit in LAST_ACK state forever. Thus, when mbuf allocation fails, set the retransmit timer if neither the retransmit or persist timer is already pending. Problem discovered by: Mike Silbersack (silby@silby.com) Pushed for a fix by: Bosko Milekic <bmilekic@dsuper.net> Reviewed by: jayanth Notes: svn path=/head/; revision=61179
* Temporarily turn off the newreno flag until we can track down the knownJayanth Vijayaraghavan2000-05-111-1/+1
| | | | | | | data corruption problem. Notes: svn path=/head/; revision=60408
* Implement TCP NewReno, as documented in RFC 2582. This allowsJonathan Lemon2000-05-061-3/+7
| | | | | | | | | | | better recovery for multiple packet losses in a single window. The algorithm can be toggled via the sysctl net.inet.tcp.newreno, which defaults to "on". Submitted by: Jayanth Vijayaraghavan <jayanth@yahoo-inc.com> Notes: svn path=/head/; revision=60067
* Add support for offloading IP/TCP/UDP checksums to NIC hardware whichJonathan Lemon2000-03-271-8/+11
| | | | | | | supports them. Notes: svn path=/head/; revision=58698
* Avoid kernel panic when tcp rfc1323 and rfc1644 options are enabledYoshinobu Inoue2000-02-091-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | at the same time. When rfc1323 and rfc1644 option are enabled by sysctl, and tcp over IPv6 is tried, kernel panic happens by the following check in tcp_output(), because now hdrlen is bigger in such case than before. /*#ifdef DIAGNOSTIC*/ if (max_linkhdr + hdrlen > MHLEN) panic("tcphdr too big"); /*#endif*/ So change the above check to compare with MCLBYTES in #ifdef INET6 case. Also, allocate a mbuf cluster for the header mbuf, in that case. Bug reported at KAME environment. Approved by: jkh Reviewed by: sumikawa Obtained from: KAME project Notes: svn path=/head/; revision=57068
* Fixed the problem that IPsec connection hangs when bigger data is sent.Yoshinobu Inoue2000-01-151-0/+5
| | | | | | | | | | -opt_ipsec.h was missing on some tcp files (sorry for basic mistake) -made buildable as above fix -also added some missing IPv4 mapped IPv6 addr consideration into ipsec4_getpolicybysock Notes: svn path=/head/; revision=56041
* tcp updates to support IPv6.Yoshinobu Inoue2000-01-091-22/+142
| | | | | | | | | | also a small patch to sys/nfs/nfs_socket.c, as max_hdr size change. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55679
* Restructure TCP timeout handling:Jonathan Lemon1999-08-301-27/+46
| | | | | | | | | | | | | - eliminate the fast/slow timeout lists for TCP and instead use a callout entry for each timer. - increase the TCP timer granularity to HZ - implement "bad retransmit" recovery, as presented in "On Estimating End-to-End Network Path Properties", by Allman and Paxson. Submitted by: jlemon, wollmann Notes: svn path=/head/; revision=50673
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Added net.inet.tcp.path_mtu_discovery variable which when set to 0David Greenman1999-05-271-8/+9
| | | | | | | | | | (default 1) disables PMTUD globally. Although PMTUD can be disabled in the standard case by locking the MTU on a static route (including the default route), this method doesn't work in the face of dynamic routing protocols like gated. Notes: svn path=/head/; revision=47547
* Two cosmetic changes, one a typo and the other, a clarification.Julian Elischer1999-04-071-2/+2
| | | | Notes: svn path=/head/; revision=45439
* Add a flag, passed to pru_send routines, PRUS_MORETOCOME. ThisBill Fenner1999-01-201-2/+3
| | | | | | | | | | | | flag means that there is more data to be put into the socket buffer. Use it in TCP to reduce the interaction between mbuf sizes and the Nagle algorithm. Based on: "Justin C. Walker" <justin@apple.com>'s description of Apple's fix for this problem. Notes: svn path=/head/; revision=42902
* Fixed overflow and sign extension bugs inBruce Evans1998-07-131-4/+4
| | | | | | | | | | | | | | `len = min(so->so_snd.sb_cc, win) - off;'. min() has type u_int and `off' has type int, so when min() is 0 and `off' is 1, the RHS overflows to 0U - 1 = UINT_MAX. `len' has type long, so when sizeof(long) == sizeof(int), the LHS normally overflows to to the correct value of -1, but when sizeof(long) > sizeof(int), the LHS is UINT_MAX. Fixed some u_long's that should have been fixed-sized types. Notes: svn path=/head/; revision=37623
* Take IP options into account when calculating the allowable lengthBill Fenner1998-05-241-4/+13
| | | | | | | | | | of the TCP payload. See RFC1122 section 4.2.2.6 . This allows Path MTU discovery to be used along with IP options. PR: problem discovered by Kevin Lahey <kml@nas.nasa.gov> Notes: svn path=/head/; revision=36335
* Remove the last traces of TUBA.Poul-Henning Kamp1998-04-061-6/+1
| | | | | | | Inspired by: PR kern/3317 Notes: svn path=/head/; revision=35056
* Don't depend on "implicit int".Bruce Evans1998-02-201-2/+2
| | | | Notes: svn path=/head/; revision=33678
* Don't allow the window to be increased beyond what is possible toBill Fenner1997-10-071-3/+3
| | | | | | | | | | | | | | | represent in the TCP header. The old code did effectively: win = min(win, MAX_ALLOWED); win = max(win, what_i_think_i_advertised_last_time); so if what_i_think_i_advertised_last_time is bigger than can be represented in the header (e.g. large buffers and no window scaling) then we stuff a too-big number into a short. This fix reverses the order of the comparisons. PR: kern/4712 Notes: svn path=/head/; revision=30209
* Make TCPDEBUG a new-style option.Joerg Wunsch1997-09-161-1/+3
| | | | Notes: svn path=/head/; revision=29514
* Removed unused #includes.Bruce Evans1997-08-021-4/+1
| | | | Notes: svn path=/head/; revision=27845
* Reorganize elements of the inpcb struct to take better advantage ofDavid Greenman1997-04-031-3/+3
| | | | | | | | | | | cache lines. Removed the struct ip proto since only a couple of chars were actually being used in it. Changed the order of compares in the PCB hash lookup to take advantage of partial cache line fills (on PPro). Discussed-with: wollman Notes: svn path=/head/; revision=24570
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Changed some memcpy()'s back to bcopy()'s.Bruce Evans1996-06-081-2/+2
| | | | | | | | | | gcc only inlines memcpy()'s whose count is constant and didn't inline these. I want memcpy() in the kernel go away so that it's obvious that it doesn't need to be optimized. Now it is only used for one struct copy in si.c. Notes: svn path=/head/; revision=16206
* Two fixes from Rich Stevens:David Greenman1996-04-151-5/+8
| | | | | | | | | | | | 1) Set the persist timer to help time-out connections in the CLOSING state. 2) Honor the keep-alive timer in the CLOSING state. This fixes problems with connections getting "stuck" due to incompletion of the final connection shutdown which can be a BIG problem on busy WWW servers. Notes: svn path=/head/; revision=15262
* Move or add #include <queue.h> in preparation for upcoming struct socketDavid Greenman1996-03-111-2/+2
| | | | | | | changes. Notes: svn path=/head/; revision=14546
* Be more conservative when T/TCP extensions are disabled. In particular,Andras Olah1996-01-171-1/+14
| | | | | | | do not send data and/or FIN on SYN segments in this case. Notes: svn path=/head/; revision=13475
* Path MTU Discovery is now standard.Garrett Wollman1995-12-051-6/+6
| | | | Notes: svn path=/head/; revision=12635
* Fix a logical error in T/TCP: when we actively open a connection, weAndras Olah1995-11-031-10/+3
| | | | | | | | | | | | | have to decide whether to send a CC or CCnew option in our SYN segment depending on the contents of our TAO cache. This decision has to be made once when the connection starts. The earlier code delayed this decision until the segment was assembled in tcp_output() and retransmitted SYN segments could have different CC options. Reviewed by: Richard Stevens, davidg, wollman Notes: svn path=/head/; revision=12045
* The ability to administratively change the MTU of an interface presentsGarrett Wollman1995-10-161-1/+13
| | | | | | | | | | a few new wrinkles for MTU discovery which tcp_output() had better be prepared to handle. ip_output() is also modified to do something helpful in this case, since it has already calculated the information we need. Notes: svn path=/head/; revision=11537
* Merge 4.4-Lite-2: update version number (we already have the same fixes).Garrett Wollman1995-09-221-5/+4
| | | | | | | Obtained from: 4.4BSD-Lite-2 Notes: svn path=/head/; revision=10965
* Add support in TCP for Path MTU discovery. This is highly experimentalGarrett Wollman1995-09-201-6/+18
| | | | | | | | | | and gated on `options MTUDISC' in the source. It is also practically untested becausse (sniff!) I don't have easy access to a network with an MTU of less than an Ethernet. If you have a small MTU network, please try it and tell me if it works! Notes: svn path=/head/; revision=10930
* If tcp_output() is unable to allocate space for a copy of the data waitingGarrett Wollman1995-09-131-3/+6
| | | | | | | | | | | | to be sent, just clean up and return ENOBUFS rather than silently proceeding without sending any of the data. This makes it consistent with the `#ifdef notyet' case immediately above. Reviewed by: Andras Olah <olah@freebsd.org> Obtained from: Lite-2 Notes: svn path=/head/; revision=10712
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-11/+11
| | | | Notes: svn path=/head/; revision=8876
* Replaced some bcopy()'s with memcpy()'s so that gcc while inline/optimize.David Greenman1995-05-091-4/+4
| | | | Notes: svn path=/head/; revision=8384
* Implemented PCB hashing. Includes new functions in_pcbinshash, in_pcbrehash,David Greenman1995-04-091-1/+2
| | | | | | | and in_pcblookuphash. Notes: svn path=/head/; revision=7684
* Transaction TCP support now standard. Hack away!Garrett Wollman1995-02-161-23/+1
| | | | Notes: svn path=/head/; revision=6475
* Merge Transaction TCP, courtesy of Andras Olah <olah@cs.utwente.nl> andGarrett Wollman1995-02-091-15/+145
| | | | | | | | | | | | Bob Braden <braden@isi.edu>. NB: This has not had David's TCP ACK hack re-integrated. It is not clear what the correct solution to this problem is, if any. If a better solution doesn't pop up in response to this message, I'll put David's code back in (or he's welcome to do so himself). Notes: svn path=/head/; revision=6283
* Kill previous commit as it isn't necessary.David Greenman1995-01-261-6/+1
| | | | Notes: svn path=/head/; revision=5919
* Extended the previous change to cover the non-options case, too.David Greenman1995-01-241-1/+6
| | | | Notes: svn path=/head/; revision=5835
* Applied fix from Andreas Schulz with a different comment by me. Fixes aDavid Greenman1995-01-231-1/+6
| | | | | | | | | bug where TCP connections are closed prematurely. Submitted by: Andreas Schulz Notes: svn path=/head/; revision=5802
* Made TCPDEBUG truely optional. Based on changes I made in FreeBSD 1.1.5.David Greenman1994-09-151-1/+5
| | | | | | | | Fixed somebody's idea of a joke - about the first half of the lines in in_proto.c were spaced over by one space. Notes: svn path=/head/; revision=2788
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817