aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Complete the (mechanical) move of the TCP reassembly and timewaitAndre Oppermann2007-05-135-624/+23
| | | | | | | | | | functions from their origininal place to their own files. TCP Reassembly from tcp_input.c -> tcp_reass.c TCP Timewait from tcp_subr.c -> tcp_timewait.c Notes: svn path=/head/; revision=169541
* Drop everything that doesn't belong into this new file.Andre Oppermann2007-05-111-1929/+0
| | | | | | | It's neither functional not connected to the build yet. Notes: svn path=/head/; revision=169482
* Drop everything that doesn't belong into this new file.Andre Oppermann2007-05-111-2980/+0
| | | | | | | It's neither functional nor connected to the build yet. Notes: svn path=/head/; revision=169481
* Make the TCP timer callout obtain Giant if the network stack is markedAndre Oppermann2007-05-111-2/+6
| | | | | | | | | as non-mpsafe. This change is to be removed when all protocols are mp-safe. Notes: svn path=/head/; revision=169480
* Add the timestamp offset to struct tcptw so we can generate properAndre Oppermann2007-05-113-6/+13
| | | | | | | | ACKs in TIME_WAIT state that don't get dropped by the PAWS check on the receiver. Notes: svn path=/head/; revision=169477
* Coalesce two identical UCB licenses into a single license instance withRobert Watson2007-05-111-108/+87
| | | | | | | | | | | one set of copyright years. White space and comment cleanup. Export $FreeBSD$ via __FBSDID. Notes: svn path=/head/; revision=169469
* Minor white space and style cleanups.Robert Watson2007-05-111-36/+27
| | | | Notes: svn path=/head/; revision=169467
* White space and style cleanup.Robert Watson2007-05-111-10/+11
| | | | Notes: svn path=/head/; revision=169466
* Minor white space/style normalization.Robert Watson2007-05-111-6/+8
| | | | Notes: svn path=/head/; revision=169465
* Normalize style a bit: reduce pseudo-randomness of comment layout andRobert Watson2007-05-112-74/+75
| | | | | | | white space. Remove 'register'. Notes: svn path=/head/; revision=169464
* Reduce network stack oddness: implement .pru_sockaddr and .pru_peeraddrRobert Watson2007-05-116-26/+18
| | | | | | | | | | | protocol entry points using functions named proto_getsockaddr and proto_getpeeraddr rather than proto_setsockaddr and proto_setpeeraddr. While it's true that sockaddrs are allocated and set, the net effect is to retrieve (get) the socket address or peer address from a socket, not set it, so align names to that intent. Notes: svn path=/head/; revision=169462
* Remove unneeded wrappers for in_setsockaddr() and in_setpeeraddr(), whichRobert Watson2007-05-113-74/+6
| | | | | | | | used to exist so pcbinfo locks could be acquired, but are no longer required as a result of socket/pcb reference model refinements. Notes: svn path=/head/; revision=169461
* Fix an incorrect replace of a timer reference made during the TCP timerAndre Oppermann2007-05-101-1/+1
| | | | | | | | rewrite in rev. 1.132. This unmasked yet another bug that causes certain connections to get indefinately stuck in LAST_ACK state. Notes: svn path=/head/; revision=169457
* Move universally to ANSI C function declarations, with relativelyRobert Watson2007-05-1024-253/+149
| | | | | | | consistent style(9)-ish layout. Notes: svn path=/head/; revision=169454
* Two major items here:Randall Stewart2007-05-0913-1792/+1119
| | | | | | | | | | | | | | | | | | - All printf that was surrounded by #ifdef SCTP_DEBUG moves to a macro that does all of this. This removes all printfs from the code and makes the code more portable and easier to read. - Static Analysis (cisco) - found a few bugs, but mostly we add checks for NULL pointers and such to make the tool happy. We now pass the Cisco SA tools checks except for where it does not understand tailq/lists. We still need to look at the coverity tools output too (this is like the cisco SA tool) and see if it wants us to fix any other items. Hopefully this will be the last major churn in the code other than bug fixes. Notes: svn path=/head/; revision=169420
* o Fix style(9) bugs introduced in the last commit.Maxim Konovalov2007-05-092-6/+6
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=169417
* o Unbreak "options TCPDEBUG" && "nooptions INET6" kernel build.Maxim Konovalov2007-05-092-0/+4
| | | | | | | | PR: kern/112517 Submitted by: vd Notes: svn path=/head/; revision=169405
* - Copyright change, cisco's silly tool wants it to say:Randall Stewart2007-05-0834-34/+34
| | | | | | | | | | | "Copyright (c) 2001-2007, by Cisco Systems," instead of *Copyright (c) 2001-2007, Cisco Systems," - Also fix a few straglers that were still in 2006. Notes: svn path=/head/; revision=169382
* - Get rid of the sctp_inpcb_free() "magic numbers", now theyRandall Stewart2007-05-084-11/+31
| | | | | | | | are sensible defines that tell what you are directing the function to do. Notes: svn path=/head/; revision=169380
* - Static analyisis fixes for cisco's commit (this is equivilantRandall Stewart2007-05-0813-250/+297
| | | | | | | | | | | to the coverity tool.. may even be the same one.. not sure). - A bug in the way sctp_abort() and friends were setting the IP_CLOSE flag.. and NOT passing the last argument as a (,1)... so that things would get freed.. Notes: svn path=/head/; revision=169378
* - More macros for OS compatabiltyRandall Stewart2007-05-0820-710/+1224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - PR-SCTP would ignore FWD-TSN's above a rwnd's worth of TSN's (1 byte msgs).. this left the peer hopelessly out of sync.. or an attacker. So now we abort the assoc. - New IFN hash, also rename hashes to match addr/ifn now that the vrf has multiple. - Do not enable SCTP_PCB_FLAGS_RECVDATAIOEVNT per default as defined in the Socket API ID. - Export MTU information via sysctl. - Vrf's need table id's. This is default for BSD, but may be other things later when BSD fully supports VRFs. - Additional stream reset bug (caught by cisco dev-test). - Additional validations for the address in sending a message (socket api). -------- and ----- - Fix association notifications not to give the active open side false notifications. - Fix so sendfile and SENDALL will work properly (missing flag to say socket sender is done). - Fix Bug that prevented COOKIES from being retransmitted. - Break out connectx into helper sub-models so that iox routines can reuse the helpers. - When an address is added during system init (non-dynamic mode) make sure that the "defer use" flag is not set. ** its compiling on XR now :-D ** Reviewed by: gnn Notes: svn path=/head/; revision=169352
* Rather than selectively zeroing fields in the tcp_debug structureRobert Watson2007-05-071-42/+15
| | | | | | | | | throughout tcp_trace(), zero the entire structure up front. Minor style fixes. Notes: svn path=/head/; revision=169350
* Since udp_peeraddr() and udp_sockaddr() directly wrap in_setpeeraddr()Robert Watson2007-05-071-25/+2
| | | | | | | | | and in_setsockaddr(), containing only stale comments on why they exist, remove them and initialize the protosw for UDP to directly reference in_setpeeraddr() and in_setsockaddr(). Notes: svn path=/head/; revision=169349
* Minor style tweaks.Robert Watson2007-05-071-17/+22
| | | | Notes: svn path=/head/; revision=169348
* When setting up timewait state for a TCP connection, don't hold theRobert Watson2007-05-072-2/+2
| | | | | | | | socket lock over a crhold() of so_cred: so_cred is constant after socket creation, so doesn't require locking to read. Notes: svn path=/head/; revision=169347
* Remove unused requested_s_scale from struct tcpcb.Andre Oppermann2007-05-062-3/+2
| | | | Notes: svn path=/head/; revision=169318
* Use existing TF_SACK_PERMIT flag in struct tcpcb t_flags field instead ofAndre Oppermann2007-05-068-59/+60
| | | | | | | a decdicated sack_enable int for this bool. Change all users accordingly. Notes: svn path=/head/; revision=169317
* o Remove redundant tcp reassembly check in header prediction codeAndre Oppermann2007-05-062-38/+18
| | | | | | | | | o Rearrange code to make intent in TCPS_SYN_SENT case more clear o Assorted style cleanup o Comment clarification for tcp_dropwithreset() Notes: svn path=/head/; revision=169316
* Reorder the TCP header prediction test to check for the most volatileAndre Oppermann2007-05-062-8/+12
| | | | | | | values first to spend less time on a fallback to normal processing. Notes: svn path=/head/; revision=169315
* Remove the defunct remains of the TCPS_TIME_WAIT cases from tcp_do_segmentAndre Oppermann2007-05-062-130/+34
| | | | | | | | | | | and change it to a void function. We use a compressed structure for TCPS_TIME_WAIT to save memory. Any late late segments arriving for such a connection is handled directly in the TW code. Notes: svn path=/head/; revision=169314
* Fix two comments.Andre Oppermann2007-05-061-2/+2
| | | | Notes: svn path=/head/; revision=169309
* Two bugs:Randall Stewart2007-05-062-10/+37
| | | | | | | | | | | - Locks were not being unlocked when an invalid size chunk is sent in. - When a notification comes in, we cannot use it to look up the fragment interleave stream information since its not on a stream. Notes: svn path=/head/; revision=169295
* Add global mutex tcp_debug_mtx, which will protect global TCP debuggingRobert Watson2007-05-042-13/+32
| | | | | | | | | | | | | | state tcp_debug, tcp_debx. Acquire and drop as required in tcp_trace(). Move to ANSI C function header, correct prototype types so that short TCP state is no longer promoted to int unnecessarily. Add comments. MFC after: 3 weeks Notes: svn path=/head/; revision=169272
* Tweak comment at end of tcp_input() when calling into tcp_do_segment(): theRobert Watson2007-05-042-6/+6
| | | | | | | pcbinfo lock will be released as well, not just the pcb lock. Notes: svn path=/head/; revision=169268
* Fixes a missing unlock in the one-2-one hash table, ifRandall Stewart2007-05-042-0/+4
| | | | | | | | | it was full and a collision occured, then we would leave a inp locked. Also fixes a missing inp unlock if IPSEC was on and it failed during the attach. Bug found by Weongyo Jeong. Notes: svn path=/head/; revision=169254
* Add support for filtering on Routing Header Type 0 andBjoern A. Zeeb2007-05-042-0/+6
| | | | | | | | | | Mobile IPv6 Routing Header Type 2 in addition to filter on the non-differentiated presence of any Routing Header. MFC after: 3 weeks Notes: svn path=/head/; revision=169245
* sblock() implements a sleep lock by interlocking SB_WANT and SB_LOCK flagsRobert Watson2007-05-031-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | on each socket buffer with the socket buffer's mutex. This sleep lock is used to serialize I/O on sockets in order to prevent I/O interlacing. This change replaces the custom sleep lock with an sx(9) lock, which results in marginally better performance, better handling of contention during simultaneous socket I/O across multiple threads, and a cleaner separation between the different layers of locking in socket buffers. Specifically, the socket buffer mutex is now solely responsible for serializing simultaneous operation on the socket buffer data structure, and not for I/O serialization. While here, fix two historic bugs: (1) a bug allowing I/O to be occasionally interlaced during long I/O operations (discovere by Isilon). (2) a bug in which failed non-blocking acquisition of the socket buffer I/O serialization lock might be ignored (discovered by sam). SCTP portion of this patch submitted by rrs. Notes: svn path=/head/; revision=169236
* - Somehow the disable fragment option got lost. We couldRandall Stewart2007-05-0217-354/+562
| | | | | | | | | | | | | | | set/clear it but would not do it. Now we will. - Moved to latest socket api for extended sndrcv info struct. - Moved to support all new levels of fragment interleave (0-2). - Codenomicon security test updates - length checks and such. - Bug in stream reset (2 actually). - setpeerprimary could unlock a null pointer, fixed. - Added a flag in the pcb so netstat can see if we are listening easier. Obtained from: (some of the Listen changes from Weongyo Jeong) Notes: svn path=/head/; revision=169208
* Remove unused pcbinfo arguments to in_setsockaddr() andRobert Watson2007-05-016-14/+12
| | | | | | | in_setpeeraddr(). Notes: svn path=/head/; revision=169179
* Rename some fields of struct inpcbinfo to have the ipi_ prefix,Robert Watson2007-04-307-77/+113
| | | | | | | | | consistent with the naming of other structure field members, and reducing improper grep matches. Clean up and comment structure fields in structure definition. Notes: svn path=/head/; revision=169154
* o Kill EOLWS while I'm here.Maxim Konovalov2007-04-301-2/+2
| | | | Notes: svn path=/head/; revision=169149
* o Fix strtoul() error conditions check.Maxim Konovalov2007-04-301-1/+1
| | | | | | | | | PR: kern/108211 Submitted by: Yong Tang MFC after: 2 weeks Notes: svn path=/head/; revision=169148
* o Fix INP lock leak in the minttl caseAndre Oppermann2007-04-232-10/+12
| | | | | | | | o Remove indirection in the decision of unlocking inp o Further annotation of locking in tcp_input() Notes: svn path=/head/; revision=168986
* Fixes cut and paste bug using wrong pointer reference.Randall Stewart2007-04-231-6/+6
| | | | Notes: svn path=/head/; revision=168961
* Moves the PCB features and flags from sctp_pcb.h toRandall Stewart2007-04-222-53/+54
| | | | | | | | sctp.h so that netstat can access and display these values. Notes: svn path=/head/; revision=168945
* - Somehow the disable fragment option got lost. We couldRandall Stewart2007-04-2212-57/+150
| | | | | | | | | set/clear it but would not do it. Now we will. - Moved to latest socket api for extended sndrcv info struct. - Moved to support all new levels of fragment interleave. Notes: svn path=/head/; revision=168943
* o Remove unncessary TOF_SIGLEN flag from struct tcpoptAndre Oppermann2007-04-203-8/+9
| | | | | | | | o Correctly set to->to_signature in tcp_dooptions() o Update comments Notes: svn path=/head/; revision=168906
* Add more KASSERT's.Andre Oppermann2007-04-202-0/+8
| | | | Notes: svn path=/head/; revision=168905
* o Remove unused and redundant TCP option definitionsAndre Oppermann2007-04-203-15/+6
| | | | | | | | o Replace usage of MAX_TCPOPTLEN with the correctly constructed and derived MAX_TCPOPTLEN Notes: svn path=/head/; revision=168904
* Remove bogus check for accept queue length and associated failure handlingAndre Oppermann2007-04-204-35/+23
| | | | | | | | | | | | | | | | | from the incoming SYN handling section of tcp_input(). Enforcement of the accept queue limits is done by sonewconn() after the 3WHS is completed. It is not necessary to have an earlier check before a connection request enters the SYN cache awaiting the full handshake. It rather limits the effectiveness of the syncache by preventing legit and illegit connections from entering it and having them shaken out before we hit the real limit which may have vanished by then. Change return value of syncache_add() to void. No status communication is required. Notes: svn path=/head/; revision=168903