aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_output.h
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace changes.Michael Tuexen2020-09-241-6/+5
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=366114
* net: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-8/+0
| | | | Notes: svn path=/head/; revision=365071
* Non-functional changes due to upstream cleanup.Michael Tuexen2020-06-111-13/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=362054
* Retire SCTP_SO_LOCK_TESTING.Michael Tuexen2020-06-071-6/+0
| | | | | | | | | | | | This was intended to test the locking used in the MacOS X kernel on a FreeBSD system, to make use of WITNESS and other debugging infrastructure. This hasn't been used for ages, to take it out to reduce the #ifdef complexity. MFC after: 1 week Notes: svn path=/head/; revision=361895
* Improve the handling of state cookie parameters in INIT-ACK chunks.Michael Tuexen2019-09-011-2/+2
| | | | | | | | | | | | | | | | | This fixes problem with parameters indicating a zero length or partial parameters after an unknown parameter indicating to stop processing. It also fixes a problem with state cookie parameters after unknown parametes indicating to stop porcessing. Thanks to Mark Wodrich from Google for finding two of these issues by fuzz testing the userland stack and reporting them in https://github.com/sctplab/usrsctp/issues/355 and https://github.com/sctplab/usrsctp/issues/352 MFC after: 3 days Notes: svn path=/head/; revision=351654
* Whitespace changes due to changes in ident.Michael Tuexen2018-07-191-5/+5
| | | | Notes: svn path=/head/; revision=336511
* Revert https://svnweb.freebsd.org/changeset/base/336503Michael Tuexen2018-07-191-9/+9
| | | | | | | since I also ran the export script with different parameters. Notes: svn path=/head/; revision=336508
* Whitespace changes due to change if ident.Michael Tuexen2018-07-191-9/+9
| | | | Notes: svn path=/head/; revision=336503
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Code cleanup, no functional change.Michael Tuexen2017-09-211-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=323861
* Fix the handling of Explicit EOR mode.Michael Tuexen2017-07-151-0/+5
| | | | | | | | | | | | While there, appropriately handle the overhead depending on the usage of DATA or I-DATA chunks. Take the overhead only into account, when required. Joint work with rrs@ MFC after: 1 week Notes: svn path=/head/; revision=321034
* Whitespace changes.Michael Tuexen2016-12-261-4/+4
| | | | | | | | | | The toolchain for processing the sources has been updated. No functional change. MFC after: 3 days Notes: svn path=/head/; revision=310590
* Don't allow a remote encapsulation port change during theMichael Tuexen2016-01-301-1/+2
| | | | | | | | | SCTP restart procedure. MFC after: 3 days Notes: svn path=/head/; revision=295072
* Fix an issue with MAC OS locking and also optimize the caseRandall Stewart2015-07-241-1/+1
| | | | | | | | | | where we are sending back a stream-reset and a sack timer is running, in that case we should just send the SACK. MFC after: 3 weeks Notes: svn path=/head/; revision=285837
* Fix several problems with Stream Reset.Randall Stewart2015-07-221-4/+7
| | | | | | | | | | | | 1) We were not handling (or sending) the IN_PROGRESS case if the other side (or our side) was not able to reset (awaiting more data). 2) We would improperly send a stream-reset when we should not. Not waiting until the TSN had been assigned when data was inqueue. Reviewed by: tuexen Notes: svn path=/head/; revision=285792
* Add FIB support for SCTP.Michael Tuexen2015-06-171-3/+3
| | | | | | | | | This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200379 MFC after: 3 days Notes: svn path=/head/; revision=284515
* Ensure that the list of streams sent in a stream reset parameter fitsMichael Tuexen2014-10-081-2/+2
| | | | | | | | in an mbuf-cluster. Thanks to Peter Bostroem for drawing my attention to this part of the code. Notes: svn path=/head/; revision=272751
* Cleanup the handling of address scopes. Announce in the INIT/INIT-ACKMichael Tuexen2013-02-091-6/+2
| | | | | | | | | | only the supported address types. While there, do some whitespace cleanups. MFC after: 1 week Notes: svn path=/head/; revision=246595
* Ensure that the padding of the last parameter of an INIT chunkMichael Tuexen2012-12-081-1/+2
| | | | | | | | | | is not included in the chunk length as required by RFC 4960. While there, cleanup sctp_send_initiate(). MFC after: 2 weeks Notes: svn path=/head/; revision=244021
* Small cleanups. No functional change.Michael Tuexen2012-09-221-25/+7
| | | | | | | MFC after: 10 days Notes: svn path=/head/; revision=240826
* Pass the src and dst address of a received packet explicitly around.Michael Tuexen2012-06-281-6/+9
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237715
* Pass the packet length explicitly around.Michael Tuexen2012-06-241-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237542
* Pass flowid explicitly through the stack instead of taking it fromMichael Tuexen2012-06-141-5/+11
| | | | | | | | | | the mbuf chain at different places. While there: Fix several bugs related to VRFs. MFC after: 3 days Notes: svn path=/head/; revision=237049
* Unify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks.Michael Tuexen2012-06-121-1/+3
| | | | | | | | | While there: Fix also some minor bugs and prepare for SCTP/DTLS. MFC after: 3 days Notes: svn path=/head/; revision=236956
* Use consistent text at the begining of the files.Michael Tuexen2012-05-231-6/+4
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=235828
* Make stream our stream reset implementationRandall Stewart2012-03-291-6/+4
| | | | | | | | | compliant to RFC6525. MFC after: 1 month Notes: svn path=/head/; revision=233660
* Fix unused parameter warnings.Michael Tuexen2011-12-171-3/+3
| | | | | | | | | While there, fix some whitespace issues. MFC after: 3 months. Notes: svn path=/head/; revision=228653
* The result of a joint work between rrs@ and myself at the IETF:Michael Tuexen2011-08-031-1/+1
| | | | | | | | | | | | | | * Decouple the path supervision using a separate HB timer per path. * Add support for potentially failed state. * Bring back RTO.min to 1 second. * Accept packets on IP-addresses already announced via an ASCONF * While there: do some cleanups. Approved by: re@ MFC after: 2 months. Notes: svn path=/head/; revision=224641
* Fix the source address selection for boundall socketsMichael Tuexen2011-05-141-0/+1
| | | | | | | | | | | | | | when sending INITs to a global IPv4 address having only private IPv4 address. Allow the usage of a private address and make sure that no other private address will be used by the association. Initial work was done by rrs@. MFC after: 1 week. Notes: svn path=/head/; revision=221904
* Fix a locking issue showing up on Mac OS X when subscribing toMichael Tuexen2011-05-081-2/+2
| | | | | | | | | authentication events. DTLS/SCTP renegotiations trigger the bug. MFC after: 2 weeks. Notes: svn path=/head/; revision=221627
* 1) Typo correction in comments and one spacing change.Randall Stewart2011-02-051-0/+2
| | | | | | | | 2) Mass update to all copyrights. MFC after: 3 Months Notes: svn path=/head/; revision=218319
* Fixes to ECN in SCTP.Randall Stewart2011-01-291-1/+1
| | | | | | | | | | | | | | | | 1) ECN was on an association basis, this is incorrect and will not work with CMT or for that matter if the user is sending to multiple addresses. This commit makes ECN on a per path basis. 2) Adopt the new format for the ECN internet draft. This also maintains compatability with old format chunks as well. 3) Keep track of the real time of a RTT down to micro seconds. For some future conditional features (for like a data center this is good information to have). MFC after: 1 month Notes: svn path=/head/; revision=218072
* Add stream scheduling support.Michael Tuexen2011-01-231-5/+0
| | | | | | | | | This work is based on a patch received from Robin Seggelmann. MFC after: 3 months. Notes: svn path=/head/; revision=217760
* Delay the assignment of a path for DATA chunk until they hitMichael Tuexen2010-09-151-0/+2
| | | | | | | | | | the sent_queue. Honor a given path when the SCTP_ADDR_OVER flag is set. MFC after: 2 weeks. Notes: svn path=/head/; revision=212712
* * Fix some race condition in SACK/NR-SACK processing.Michael Tuexen2010-04-031-3/+0
| | | | | | | | | | | * Fix handling of mapping arrays when draining mbufs or processing FORWARD-TSN chunks. * Cleanup code (no duplicate code anymore for SACKs and NR-SACKs). Part of this code was developed together with rrs. MFC after: 2 weeks. Notes: svn path=/head/; revision=206137
* Fix handling of SHUTDOWN-ACK chunk in COOKIE_WAIT and COOKIE_ECHOED.Michael Tuexen2010-02-201-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=204141
* Fix the add stream feature of strm-reset to really work:Randall Stewart2009-02-271-0/+5
| | | | | | | | | | | | | | - Fix the copy, we can't do a blind copy but must transfer the data from the old to the new. - Fix the ACK processing so we properly stop retransmitting the thing. - Fix it so if we get a retran we will properly reply with the saved response without doing anything. MFC after: 1 month Notes: svn path=/head/; revision=189121
* Add the add-stream capability. Still needs moreRandall Stewart2009-02-201-3/+7
| | | | | | | | | testing.. MFC after: 1 month Notes: svn path=/head/; revision=188854
* Code from the hack-session known as the IETF (and aRandall Stewart2008-12-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bit of debugging afterwards): - Fix protection code for notification generation. - Decouple associd from vtag - Allow vtags to have less strigent requirements in non-uniqueness. o don't pre-hash them when you issue one in a cookie. o Allow duplicates and use addresses and ports to discriminate amongst the duplicates during lookup. - Add support for the NAT draft draft-ietf-behave-sctpnat-00, this is still experimental and needs more extensive testing with the Jason Butt ipfw changes. - Support for the SENDER_DRY event to get DTLS in OpenSSL working with a set of patches from Michael Tuexen (hopefully heading to OpenSSL soon). - Update the support of SCTP-AUTH by Peter Lei. - Use macros for refcounting. - Fix MTU for UDP encapsulation. - Fix reporting back of unsent data. - Update assoc send counter handling to be consistent with endpoint sent counter. - Fix a bug in PR-SCTP. - Fix so we only send another FWD-TSN when a SACK arrives IF and only if the adv-peer-ack point progressed. However we still make sure a timer is running if we do have an adv_peer_ack point. - Fix PR-SCTP bug where chunks were retransmitted if they are sent unreliable but not abandoned yet. With the help of: Michael Teuxen and Peter Lei :-) MFC after: 4 weeks Notes: svn path=/head/; revision=185694
* 1) Adds the rest of the VIMAGE change macrosRandall Stewart2008-07-091-1/+4
| | | | | | | | | | | | | | | 2) Adds some __UserSpace__ on some of the common defines that the user space code needs 3) Fixes a bug when we send up data to a user that failed. We need to a) trim off the data chunk headers, if present, and b) make sure the frag bit is communicated properly for the msgs coming off the stream queues... i.e. we see if some of the msg has been taken. Obtained from: jeli contributed the VIMAGE changes on this pass Thanks Julain! Notes: svn path=/head/; revision=180387
* - Adds support for the multi-asconf (From Kozuka-san)Randall Stewart2008-05-201-4/+4
| | | | | | | | | | | | | | | | | | | | | - Adds some prepwork (Not all yet) for vimage in particular support the delete the sctppcbinfo.xx structs. There is still a leak in here if it were to be called plus we stil need the regrouping (From Me and Michael Tuexen) - Adds support for UDP tunneling. For BSD there is no socket yet setup so its disabled, but major argument changes are in here to emcompass the passing of the port number (zero when you don't have a udp tunnel, the default for BSD). Will add some hooks in UDP here shortly (discussed with Robert) that will allow easy tunneling. (Mainly from Peter Lei and Michael Tuexen with some BSD work from me :-D) - Some ease for windows, evidently leave is reserved by their compile move label leave: -> out: MFC after: 1 week Notes: svn path=/head/; revision=179157
* - Bug fix managing congestion parameter on immediateRandall Stewart2007-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | retransmittion by handover event (fast mobility code) - Fixed problem of mobility code which is caused by remaining parameters in the deleted primary destination. - Add a missing lock. When a peer sends an INIT, and while we are processing it to send an INIT-ACK the socket is closed, we did not hold a lock to keep the socket from going away. Add protection for this case. - Fix so that arwnd is alway uses the minimal rwnd if the user has set the socket buffer smaller. Found this when the test org decided to see what happens when you set in a rwnd of 10 bytes (which is not allowed per RFC .. 4k is minimum). - Fixes so a cookie-echo ootb will NOT cause an abort to be sent. This was happening in a MPI collision case. - Examined all panics and unless there was no recovery, moved any that were not already to INVARANTS. Approved by: re@freebsd.org (gnn) Notes: svn path=/head/; revision=172396
* - Get rid of unsused constants for sysctl variables.Randall Stewart2007-09-151-1/+1
| | | | | | | | | | | | | | | | | - Fix panic from mutex unlock on freed lock when ASCONF-ACK aborts an assoc - Fix panic from addr lock recursion when ASCONFs are queued in the front states - ASCONFs "queued" in the front states should really be bundled after the COOKIE-ACK, not in front of it - Fix issue with addresses deleted in the front states from being sent with ASCONF(DELETE)-- replaced sctp_asconf_queue_add_sa() with delete specific function - Comment change in sctp.h the drafts are now RFC's Approved by: re@freebsd.org (B Mah) Notes: svn path=/head/; revision=172190
* - Locking compatiability changes. This involves addingRandall Stewart2007-09-081-3/+18
| | | | | | | | | | | | | | additional flags to many function calls. The flags only get used in BSD when we compile with lock testing. These flags allow apple to escape the "giant" lock it holds on the socket and have more fine-grained locking in the NKE. It also allows us to test (with witness) the locking used by apple via a compile switch (manually applied). Approved by: re@freebsd.org(B Mah) Notes: svn path=/head/; revision=172090
* - During shutdown pending, when the last sack came in andRandall Stewart2007-08-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the last message on the send stream was "null" but still there, a state we allow, we could get hung and not clean it up and wait for the shutdown guard timer to clear the association without a graceful close. Fix this so that that we properly clean up. - Added support for Multiple ASCONF per new RFC. We only (so far) accept input of these and cannot yet generate a multi-asconf. - Sysctl'd support for experimental Fast Handover feature. Always disabled unless sysctl or socket option changes to enable. - Error case in add-ip where the peer supports AUTH and ADD-IP but does NOT require AUTH of ASCONF/ASCONF-ACK. We need to ABORT in this case. - According to the Kyoto summit of socket api developers (Solaris, Linux, BSD). We need to have: o non-eeor mode messages be atomic - Fixed o Allow implicit setup of an assoc in 1-2-1 model if using the sctp_**() send calls - Fixed o Get rid of HAVE_XXX declarations - Done o add a sctp_pr_policy in hole in sndrcvinfo structure - Done o add a PR_SCTP_POLICY_VALID type flag - yet to-do in a future patch! - Optimize sctp6 calls to reuse code in sctp_usrreq. Also optimize when we close sending out the data and disabling Nagle. - Change key concatenation order to match the auth RFC - When sending OOTB shutdown_complete always do csum. - Don't send PKT-DROP to a PKT-DROP - For abort chunks just always checksums same for shutdown-complete. - inpcb_free front state had a bug where in queue data could wedge an assoc. We need to just abandon ones in front states (free_assoc). - If a peer sends us a 64k abort, we would try to assemble a response packet which may be larger than 64k. This then would be dropped by IP. Instead make a "minimum" size for us 64k-2k (we want at least 2k for our initack). If we receive such an init discard it early without all the processing. - When we peel off we must increment the tcb ref count to keep it from being freed from underneath us. - handling fwd-tsn had bugs that caused memory overwrites when given faulty data, fixed so can't happen and we also stop at the first bad stream no. - Fixed so comm-up generates the adaption indication. - peeloff did not get the hmac params copied. - fix it so we lock the addr list when doing src-addr selection (in future we need to use a multi-reader/one writer lock here) - During lowlevel output, we could end up with a _l_addr set to null if the iterator is calling the output routine. This means we would possibly crash when we gather the MTU info. Fix so we only do the gather where we have a src address cached. - we need to be sure to set abort flag on conn state when we receive an abort. - peeloff could leak a socket. Moved code so the close will find the socket if the peeloff fails (uipc_syscalls.c) Approved by: re@freebsd.org(Ken Smith) Notes: svn path=/head/; revision=171990
* - Take out the broken table-id concept. Panda Routers have a M-VRFRandall Stewart2007-06-011-6/+4
| | | | | | | | | | | | concept that is NOT well thought out for a multi-homed transport protocol. So the useless table-id entries passed around need to be removed. - Add a event timer for the zero copy api. - Fix a bug in sctp_timer.c when searching for an alternate with the largest ssthresh (the compare was wrong). Notes: svn path=/head/; revision=170181
* - Copyright change, cisco's silly tool wants it to say:Randall Stewart2007-05-081-1/+1
| | | | | | | | | | | "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
* - Static analyisis fixes for cisco's commit (this is equivilantRandall Stewart2007-05-081-8/+9
| | | | | | | | | | | 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-081-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* - Somehow the disable fragment option got lost. We couldRandall Stewart2007-05-021-5/+0
| | | | | | | | | | | | | | | 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