summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow to adjust tcp_syn_use_limit with sysctl net.inet.tcp.synuselimit.bluhm2016-03-291-1/+18
| | | | | | | | This is convenient to test the feature and may be useful to defend against syn flooding in a denial of service condition. It is consistent to the existing syn cache sysctls. Move some declarations to tcp_var.h to access the syn cache sets from tcp_sysctl(). OK mpi@
* Merge in_pcbbind() and in6_pcbbind(), and change every call tovgross2016-03-231-17/+4
| | | | | | in6_pcbbind() into in_pcbbind(). Ok jca@ mpi@
* in6_embedscope() needs to lose some weight. Remove the last argument.claudio2015-09-111-3/+3
| | | | | | | | | In all but two calls NULL is passed and in the other 2 cases the ifp is only used to maybe feed it to in6_selecthlim() to select the hoplimit for the link. Since in6_embedscope() only works on link-local addresses it does not matter what hop limit we select since the destination is directly reachable. OK florian@ mpi@
* When the dynamic TCP update is reducing so->so_snd.sb_hiwat thebluhm2015-08-271-1/+14
| | | | | | | | sbspace() in the socket buffer shrinks. So a writable socket reported by poll(2) could become unwritable before calling write(2). Ensure that a writable or readable socket can still be written to or read from after changing the buffer size. Discussed with and OK millert@ deraadt@ claudio@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-5/+4
| | | | ok stsp mpi
* Introduce unhandled_af() for cases where code conditionally doesjsg2015-06-071-1/+3
| | | | | | | | | | | something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@
* Replace a bunch of == 0 with == NULL in pointer tests. Nuke somekrw2015-06-071-9/+9
| | | | | | | annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* Since in_broadcast() is now used to always iterate on all the interfacesmpi2014-11-251-3/+3
| | | | | | of your system, put it on a diet and kill the superfluous logic. ok mikeb@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Remove redundant call to in{,6}_pcbbind() from tcp PRU_CONNECT.chrisz2014-04-061-11/+1
| | | | | | | Make sure that in_pcbbind() is called from in_pcbconnect() by KASSERTing that local port == 0 implies an unspecified local address. OK claudio@
* Remove unused proc argument in in6_control().mpi2013-11-221-2/+2
| | | | ok henning@, mikeb@
* Put a large chunk of the IPv6 rdomain support in-tree.phessler2013-10-201-5/+5
| | | | | | Still some important missing pieces, and this is not yet enabled. OK bluhm@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-1/+5
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* Add the TCP socket option TCP_NOPUSH to delay sending the stream.bluhm2013-08-121-1/+16
| | | | | | This is useful to aggregate data in the kernel from multiple sources like writes and socket splicing. It avoids sending small packets. From FreeBSD via David Hill; OK mikeb@ henning@
* In tcp_ctloutput() tp was assigned at two different places for IPv4bluhm2013-08-061-6/+1
| | | | | | | and IPv6. The variable tp is not accessed between these two assingments. intotcpcb() is a define without side effects. So use the same code for IPv4 and IPv6. OK claudio@ mpi@
* Move an extern declaration into its corresponding header file.mpi2013-05-171-4/+1
|
* Remove various external variable declaration from sources files andmpi2013-04-101-9/+1
| | | | | | | move them to the corresponding header with an appropriate comment if necessary. ok guenther@
* Correct the spelling of "transferred" and "transferring"guenther2012-02-241-3/+3
| | | | from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
* When used with socket splicing, tcp_usrreq() might get called withbluhm2012-01-031-2/+6
| | | | | | | | 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@
* Add sysctl net.inet.tcp.always_keepalive, when this is set the systemsthen2011-07-061-1/+5
| | | | | | | | | | | 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@
* Make in_broadcast() rdomain aware. Mostly mechanical change.claudio2011-04-281-2/+3
| | | | | | This fixes the problem of binding sockets to broadcast IPs in other rdomains. OK henning@
* Correctly inherit and set the watermarks on socketbuffers.claudio2011-04-041-11/+5
| | | | | | This fixes the NFS problems reported on the mailing list and ensures that accepted sockets have correct socketbuffer setting. OK blambert@, henning@
* In tcp_update_sndspace() and tcp_update_rcvspace() change the typebluhm2010-10-101-3/+3
| | | | | | of the variable nmax from int to u_long as the socket buffer sizes it operates on are also u_long. ok claudio@
* Fix a unfinished comment and add another one for tcp_update_(snd|rcv)space().claudio2010-09-291-2/+9
| | | | Reminded by naddy@
* TCP send and recv buffer scaling.claudio2010-09-241-3/+71
| | | | | | | | | | | | | | | | | 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@
* There is no reason to allow unicast IPv4 mapped IPv6 addresses in tcpclaudio2010-06-071-5/+2
| | | | | | 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@
* remove proc.h include from uvm_map.h. This has far reaching effects, astedu2010-04-201-1/+2
| | | | | | 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
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-9/+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@
* Remove {tcp/udp}6_usrreq(); Since the normal ones nowthib2008-05-241-14/+1
| | | | | | | take a proc argument, theres no need for these, since they are just wrappers. OK claudio@
* Deal with the situation when TCP nfs mounts timeout and processesthib2008-05-231-9/+10
| | | | | | | | | | | | | 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.
* divert for ipv6; ok henning, pyrmarkus2008-05-151-2/+2
|
* divert packets to local socket without modifying the ip header;markus2008-05-091-2/+2
| | | | makes transparent proxies much easier; ok beck@, feedback claudio@
* implement sysctls to report IP, TCP, UDP, and ICMP statistics andreyk2007-12-131-1/+8
| | | | | | | | change netstat to use them instead of accessing kvm for it. more protocols will be added later. discussed with deraadt@ claudio@ gilles@ ok deraadt@
* TCP_COMPAT_42 was last used in 1997. Kill it.deraadt2007-11-271-6/+1
| | | | ok millert
* in the strange/unnatural/ridiculous situation where a non-blockingderaadt2007-11-161-2/+5
| | | | | | | 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
* 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>
* merge tcp_set_iss() and tcp_set_tsm(); ok mcbride, djm (on earlier version)markus2007-06-251-6/+2
|
* Drop the current random timestamps and the current ISN generationmarkus2007-06-151-3/+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
* - check th_ack against snd_una/max; from Raja Mukerji via hugh@markus2005-03-041-1/+15
| | | | | | | - 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
* Move #ifdef INET6 outside of 'case AF_INET6:' in tcp_ident().mcbride2005-02-221-2/+2
| | | | | | | No functional change due to earlier check, fix from Maxim Konovalov <maxim@macomnet.ru> ok deraadt@ dhartmei@
* Modulate tcp_now by a random amount on a per-connection basis.mcbride2004-10-281-1/+8
| | | | ok markus@ frantzen@
* tcp_trace() expects short, not int; ok deraadtmarkus2004-07-151-2/+2
|
* Require NULL oldp when dropping a connection.otto2004-04-271-5/+7
| | | | ok markus@
* change tcpdrop to require newp instead of oldp; suggested by ottomarkus2004-04-261-12/+13
|
* add TCPCTL_DROP; ok deraadt, cedric, grange, ...markus2004-04-251-6/+31
|
* remove duplicate if. from pedro martelletto, ok markus@tedu2004-04-121-8/+2
|
* limit total number of queued out-of-order packets to NMBCLUSTERS/2; ok mcbridemarkus2004-03-021-1/+14
|