summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_output.c
Commit message (Collapse)AuthorAgeFilesLines
* This change does the following:rrs2010-06-051-13/+23
| | | | | | | | | | | | | 1) Fix the alignment of a comment. 2) Fix a BUG where we were NOT paying attention to the RESEND marking on retransmitting control chunks.. and worse we were not decrementing the retran count that could cause us to loop forever. 3) Add in the valdiate_no_lock function on invariants so that we will really check all ways out to be sure a lock does not slip out locked. MFC after: 1 week.
* Fix an old long time bug in generating arrs2010-05-121-3/+2
| | | | | | | fwd-tsn. This would appear when greater than the size of mbuf TSN's would need to be skipped. MFC after: 3 days
* More PR-SCTP bugs:rrs2010-05-121-2/+2
| | | | | | | | | - Make sure that when you kick the streams you add correctly using a 16 bit unsigned. - Make sure when sending out you allow FWD-TSN to skip over and list the ACKED chunks in the stream/seq list (so the rcv will kick the stream) MFC after: 3 days
* Sending a FWDTSN chunk should not affect the retran count.tuexen2010-04-251-1/+1
| | | | MFC after: 3 days.
* Use also SCTP/IPv6 checksum offloading in special cases.tuexen2010-04-031-13/+60
| | | | MFC after: 2 weeks
* * Fix some race condition in SACK/NR-SACK processing.tuexen2010-04-031-375/+138
| | | | | | | | * 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.
* Fix for NR-Sack code. The code was NOT working properly whenrrs2010-03-241-47/+25
| | | | | | | | | | | | | enabled. Basically most of the operations were incorrect causing bad sacks when you enabled nr-sack. The fixes range across 4 files and unifiy most of the processing so that we only test nr_sack flags to decide which type of sack to generate. Optimization left for this is to combine the sack generation code and make it capable of generating either sack thus shrinking out a routine. Reviewed by: tuexen@freebsd.org
* Fix handling of SHUTDOWN-ACK chunk in COOKIE_WAIT and COOKIE_ECHOED.tuexen2010-02-201-3/+13
| | | | MFC after: 1 week
* Get rid of a lot of duplicated code for NR-SACK handle.tuexen2010-01-171-13/+9
| | | | Generalize the SACK to code handle also NR-SACKs.
* Remove another set of "leaked" ifdefs that somehow foundrrs2010-01-171-4/+0
| | | | their way into FreeBSD.
* Get rid of support of an old version of the SCTP-AUTH draft.tuexen2010-01-161-8/+0
| | | | | | Get rid of unused MD5 code. MFC after: 1 week
* Get rid of unused fields addr_over which is never really used,tuexen2009-11-171-5/+0
| | | | | | only copied around. Approved by: rrs (mentor)
* Fix a bug where queued ASCONF messags are not sent out.tuexen2009-11-171-0/+1
| | | | | | Approved by: rrs (mentor) Obtained from: Irene Ruengeler MFC after: 1 month
* Improve round robin stream scheduler and cleanup some code.tuexen2009-10-291-21/+24
| | | | | Approved by: rrs (mentor) MFC after: 3 days
* Improve the round robin stream scheduler.tuexen2009-10-261-11/+5
| | | | | Approved by: rrs (mentor) MFC after: 3 days
* Use correct arguments when calling SCTP_RTALLOC().tuexen2009-10-081-2/+2
| | | | | Approved by: rrs (mentor) MFC after: 0 days
* Fix so that round robing stream scheduling works as advertisedrrs2009-10-081-25/+4
| | | | MFC after: 0 days
* Fix errnos.tuexen2009-09-201-6/+12
| | | | | Approved by: rrs(mentor) MFC after: 3 days.
* Support for VNET in SCTP (hopefully)rrs2009-09-171-9/+9
|
* Fix a crash when using one-to-one stlye socket in non-blockingtuexen2009-08-181-1/+2
| | | | | | | mode and there is no listening server. PR: 137795 Approved by: re, rrs (mentor) MFC after:immediately.
* * Fix a bug where PR-SCTP settings are ignore when using implicittuexen2009-08-151-52/+48
| | | | | | | | | | | | | | | association setup. * Fix a bug where message with illegal stream ids are not deleted. * Fix a crash when reporting back unsent messages from the send_queue. * Fix a bug related to INIT retransmission when the socket is already closed. * Fix a bug where associations were stalled when partial delivery API was enabled. * Fix a bug where the receive buffer size was smaller than the partial_delivery_point. Approved by: re, rrs (mentor) MFC after: One day.
* Changes to the NR-Sack code so that:rrs2009-06-171-7/+0
| | | | | | | | | | | | 1) All bit disappears 2) The two sets of gaps (nr and non-nr) are disjointed, you don't have gaps struck in both places. This adjusts us to coorespond to the new draft. Still to-do, cleanup the code so that there are only one set of sack routines (original NR-Sack done by E cloned all sack code).
* Many bug fixes (from the IETF hack-fest):rrs2009-04-041-1931/+121
| | | | | | | | | | | | | | | | - PR-SCTP had major issues when skipping through a multi-part message. o Did not look at socket buffer. o Did not properly handle the reassmebly queue. o The MARKED segments could interfere and un-skip a chunk causing a problem with the proper FWD-TSN. o No FR of FWD-TSN's was being done. - NR-Sack code was basically disabled. It needed fixes that never got into the real code. - CMT code had issues when the two paths were NOT the same b/w. We found a few small bugs, but also the critcal one here was not dividing the rwnd amongst the paths. Obtained from: Michael Tuexen and myself at the IETF hack-fest ;-)
* Fixes several PR-SCTP releated bugs.rrs2009-03-141-6/+50
| | | | | | | | - When sending large PR-SCTP messages over a lossy link we would incorrectly calculate the fwd-tsn - When receiving large multipart pr-sctp packets we would incorrectly send back a SACK that would renege improperly on already received packets thus causing unneeded retransmissions.
* Fixes for window probes:rrs2009-03-061-1/+1
| | | | | | 1) WP should never be marked unless flight size is 0 2) When recovering from wp if the peer ack's it we don't mark for retran 3) When recovering, we must assure a timer is still running.
* Fix the add stream feature of strm-reset to really work:rrs2009-02-271-6/+10
| | | | | | | | | | | - 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
* Add the add-stream capability. Still needs morerrs2009-02-201-20/+54
| | | | | | testing.. MFC after: 1 month
* Fix a bug. The sending was being restricted improperly byrrs2009-02-201-2/+2
| | | | | | | | the max_burst. It should only be gated by cwnd in the lower level send. Obtained from: Michael Tuexen MFC after: 1 week.
* - Cleanup checksum code.rrs2009-02-031-407/+399
| | | | | | | | | | | | | | | | | - Prepare for CRC offloading, add MIB counters (RS/MT). - Bugfix: Disable CRC computation for IPv6 addresses with local scope (MT). - Bugfix: Handle close() with SO_LINGER correctly when notifications are generated during the close() call(MT). - Bugfix: Generate DRY event when sender is dry during subscription. Only for 1-to-1 style sockets (RS/MT) - Bugfix: Put vtags for the correct amount of time into time-wait (MT). - Bugfix: Clear vtag entries correctly on expiration (MT). - Bugfix: shutdown() indicates ENOTCONN when called for unconnected 1-to-1 style sockets (MT). - Bugfix: In sctp Auth code (PL). - Add support for devices that support SCTP csum offload (igb). - Add missing sctp_associd to mib sysctl xsctp_tcb structure (RS) Obtained from: With help from Peter Lei and Michael Tuexen
* Code from the hack-session known as the IETF (and arrs2008-12-061-151/+2463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* More issues with pre-blocking:rrs2008-10-271-4/+10
| | | | | | | | | | a) Need for EEOR mode to take the min of the socket buffer size and the add more threshold, otherwise if you are so silly as to set a send buf size less than the add-more you could block forever in eeor mode. b) We were incorrectly using the sysctl vs the calculated value. This causes us to block forever if the addmore theshold is larger than then the socket buffer size.
* Two inter-related bugs.rrs2008-10-271-2/+8
| | | | | | | | | | | | | | - If we send EXACTLY the size left in the send buffer and then send again, we end up with exactly 0 bytes and don't hit the pre-block code to wait for more space. - If we fall into the loop with our max_len == 0 (the bug above) we then call in to copy out the data, setup the length of the waiting to transmit data to 0 and call the mbuf copy routine which 0 indicates copy all the data to the mbuf chain.. which it does. This then leaves a "stuck" message on the stream queue with its size exactly 0 bytes but all the data there and thus nothing left in the uio structure. We then reach a stuck forever state never being able to send data.
* - Adapt layer indication was always being given (it should onlyrrs2008-10-181-33/+28
| | | | | | | | | | be given when the user has enabled it). (Michael Tuexen) - Sack Immediately was not being set properly on the actual chunk, it was only put in the rcvd_flags which is incorrect. (Michael Tuexen) - added an ifndef userspace to one of the already present macro's for inet (Brad Penoff) Obtained from: Michael Tuexen and Brad Penoff MFC after: 4 weeks
* - Make strict-sacks be the default.rrs2008-08-281-0/+1
| | | | | | | - Change it so that without INVARIANTs there are no panics in SCTP. - sctp_timer changes so that we have a recovery mechanism when the sent list is out of order.
* Make the kernel compile with SCTP and SCTP_DEBUG butbz2008-08-241-1/+2
| | | | no INET6 defined.
* Adds support for the SCTP_PORT_REUSE optionrrs2008-07-311-1/+19
| | | | | | Fixes a refcount bug found in the process Obtained from: With the help of Michael Tuexen
* 1) Adds the rest of the VIMAGE change macrosrrs2008-07-091-13/+17
| | | | | | | | | | | | 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!
* - Macro-izes the packed declaration in all headers.rrs2008-06-141-130/+193
| | | | | | | | | | | | | | | | | | - Vimage prep - these are major restructures to move all global variables to be accessed via a macro or two. The variables all go into a single structure. - Asconf address addition tweaks (add_or_del Interfaces) - Fix rwnd calcualtion to be more conservative. - Support SACK_IMMEDIATE flag to skip delayed sack by demand of peer. - Comment updates in the sack mapping calculations - Invarients panic added. - Pre-support for UDP tunneling (we can do this on MAC but will need added support from UDP to get a "pipe" of UDP packets in. - clear trace buffer sysctl added when local tracing on. Note the majority of this huge patch is all the vimage prep stuff :-)
* - sctputil.c - If debug is on, the INPKILL timer can deref a freed value.rrs2008-05-211-90/+95
| | | | | | | | | | | | | | Change so that we save off a type field for display and NULL inp just for good measure. - sctp_output.c - Fix it so in sending to the loopback we use the src address of the inbound INIT. We don't want to do this for non local addresses since otherwise we might be ingressed filtered so we need to use the best src address and list the address sent to. Obtained from: time bug - Neil Wilson MFC after: 1 week
* - Adds support for the multi-asconf (From Kozuka-san)rrs2008-05-201-131/+527
| | | | | | | | | | | | | | | | | | - 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
* Allow SCTP to compile without INET6.rrs2008-04-161-280/+491
| | | | | | PR: 116816 Obtained from tuexen@fh-muenster.de: MFC after: 2 weeks
* 1) adds some additional loggingrrs2008-04-141-1/+106
| | | | | 2) changes to use a inqueue_bytes calculated value in max_len calc's. MFC after: 1 week
* - Takes out stray ifdef code that should not have been present.rrs2008-02-221-5/+0
|
* - More fixes for lock misses on the transfer of data torrs2007-12-071-103/+119
| | | | | | | | | the sent_queue. Sometimes I wonder why any code ever works :-) - Fix the pad of the last mbuf routine, It was working improperly on non-4 byte aligned chunks which could cause memory overruns. MFC after: 1 week
* - optimize the initialization of the SB max variables.rrs2007-12-061-7/+11
| | | | | | | | | | | | - Missing lock when sending data and moving it to the outqueue. - If a mbuf alloc fails during moving to outqueue the reassembly of the old mbuf chain was incorrect. - some_taken becomes a counter in sctputil.c instead of a set to 1. - Fix a panic to be only under invarients and have a proper recovery. - msg_flags needed to be set.to the value collected not or'd. MFC after: 1 week
* - More fixes for the non-blocking msg send, had the skip of the pre-blockrrs2007-12-041-3/+4
| | | | | | | | | test incorrect. - Fix the initial buf calculation to be more friendly, calc is the same but we use different variable to make it easier amongst the different code versions. MFC after: 1 week
* - Opps, signedness issue with one of the new var's (this is an issuerrs2007-12-041-1/+1
| | | | | | mainly in apple but with the right -Wall it could effect us too). MFC after: 1 week
* - Found a problem in non-blocking sends. Whenrrs2007-12-041-71/+96
| | | | | | | | | | | | | | | | | | | | sending, once the locks are all unlocked to do the copy's in, its possible that other events could then raise the number of bytes outstanding pushing it so not all the message would fit. This would then cause us to send only part of the message. This fix makes it so we keep a "reserved" amount that can be kept in mind when making calculations to send. - rcv msg args with a NULL/NULL for to/tolen will return an error incorrectly for the 1-2-1 model. - We were not doing 0 len return correctly and not setting cantrcv more correctly. Previouly we "fixed" this area by taking out the socantrcv since we then could not get the data out. The correct rix is to still flag the socket but alow a by-pass route to continue to read until all data is consumed. MFC after: 1 week
* - Change the Time Wait of vtags value to match the cookie-liferrs2007-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Select a tag gains ability to optionally save new tags off in the timewait system. - When looking up associations do not give back a stcb that is in the about-to-be-freed state, and instead continue looking for other candiates. - New function to query to see if value is in time-wait. - Timewait had a time comparison error that caused very few vtags to actually stay in time-wait. - When setting tags in time-wait, we now use the time requested NOT a fixed constant value. - sstat now gets the proper associd when we do the query. - When we process an association, we expect the tag chosen (if we have one from a cookie) to be in time-wait. Before we would NOT allow the assoc up by checking if its good. In theory this should have caused almost all assoc not to come up except for the time-comparison bug above (this bug was hidden by the time comparison bug :-D). - Don't save tags for nonce values in the time-wait cache since these are used only during cookie collisions and do not matter if they are unique or not. MFC after: 1 week
* - fix sctp_ifn initial refcount issue (prevents deletion)rrs2007-10-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | - fix a bug during cookie collision that prevented an association from coming up in a specific restart case. - Fix it so the shutdown-pending flag gets removed (this is more for correctness then needed) when we enter shutdown-sent or shutdown-ack-sent states. - Fix a bug that caused the receiver to sometimes NOT send a SACK when a duplicate TSN arrived. Without this fix it was possible for the association to fall down if the - Deleted primary destination is also stored when SCTP_MOBILITY_BASE. (Previously, it is stored when only SCTP_MOBILITY_FASTHANDOFF) - Fix a locking issue where we might call send_initiate_ack() and incorrectly state the lock held/not held. Also fix it so that when we release the lock the inp cannot be deleted on us. - Add the debug option that can cause the stack to panic instead of aborting an assoc. This does not and should never show up in options but is useful for debugging unexpected aborts. - Add cumack_log sent to track sending cumack information for the debug case where we are running a special log per assoc. - Added extra () aroudn sctp_sbspace macro to avoid compile warnings. MFC after: 1 week
OpenPOWER on IntegriCloud