summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_asconf.c
Commit message (Collapse)AuthorAgeFilesLines
* Make sure that we don't try to build an ASCONF-ACK chunktuexen2013-11-071-1/+2
| | | | | | | larger than what fits in the the mbuf cluster. This issue was reported by Andrew Galante. MFC after: 3 days
* Use htons()/ntohs() appropriately.tuexen2013-11-071-1/+1
| | | | | | These issues were reported by Andrew Galante. MFC after: 3 days
* Changes from upstream to improve compilation when INET or INET6tuexen2013-11-021-8/+28
| | | | | | or none of them is defined. MFC after: 3 days
* Allow the code to be compiled without warnings for any combinationtuexen2013-07-201-6/+3
| | | | | | | of INET, INET6 and SCTP_DEBUG defines. The issue was reported by Lally Singh. MFC after: 2 weeks
* Cleanup the handling of address scopes. Announce in the INIT/INIT-ACKtuexen2013-02-091-18/+12
| | | | | | | only the supported address types. While there, do some whitespace cleanups. MFC after: 1 week
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-051-5/+5
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Whitespace cleanup.tuexen2012-09-081-1/+0
| | | | MFC after: 10 days
* Using %p in a format string requires a void *.tuexen2012-09-051-3/+3
| | | | MFC after: 10 days
* Changes which improve compilation if neither INET nor INET6 is defined.tuexen2012-07-151-6/+8
| | | | MFC after: 3 days
* Pass the src and dst address of a received packet explicitly around.tuexen2012-06-281-77/+18
| | | | MFC after: 3 days
* Use an existing function to get the source address.tuexen2012-06-031-60/+10
| | | | MFC after: 3 days
* Small cleanups. No functional change.tuexen2012-06-011-2/+0
| | | | MFC after: 3 days
* Use consistent text at the begining of the files.tuexen2012-05-231-4/+3
| | | | MFC after: 3 days
* Provide in the association change notification the received ABORT chunktuexen2012-05-121-2/+1
| | | | | | if case of SCTP_COMM_LOST or SCTP_CANT_STR_ASSOC as required by RFC 6458. MFC after: 3 days
* Address issues found by clang. While there, fix also some styletuexen2011-12-271-23/+23
| | | | | | issues. MFC after: 3 months.
* Fix unused parameter warnings.tuexen2011-12-171-15/+47
| | | | | | While there, fix some whitespace issues. MFC after: 3 months.
* Fix a typo introduced intuexen2011-09-151-1/+1
| | | | | | | | http://svn.freebsd.org/changeset/base/225571 Reported by Ilya A. Arkhipov. Approved by: re MFC after: 1 month.
* Make sure that SCTP rejects broadcast, multicast and wildcard addressestuexen2011-09-151-6/+14
| | | | | | | as remote addresses. Approved by: re MFC after: 1 month.
* The result of a joint work between rrs@ and myself at the IETF:tuexen2011-08-031-20/+25
| | | | | | | | | | | * 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.
* Remove code with any effect.tuexen2011-05-031-2/+0
|
* Add a missing break. This bug was introduced in r221249.tuexen2011-05-031-0/+1
| | | | MFC after: 1 week
* Improve compilation of SCTP code without INET support.tuexen2011-04-301-345/+506
| | | | | | | | | | | | | | Some bugs where fixed while doing this: * ASCONF-ACK messages might use wrong port number when using IPv6. * Checking for additional addresses takes the correct address into account and also does not do more comparisons than necessary. This patch is based on one received from bz@ who was sponsored by The FreeBSD Foundation and iXsystems. MFC after: 1 week
* Remove addresses from endpoint when there are no associations.tuexen2011-02-101-3/+10
| | | | | | This fixes a bug reported by brucec@. MFC after: 3 months.
* 1) Typo correction in comments and one spacing change.rrs2011-02-051-3/+2
| | | | | 2) Mass update to all copyrights. MFC after: 3 Months
* 1) Move per John Baldwin to mp_maxidrrs2011-02-031-1/+4
| | | | | | | 2) Some signed/unsigned errors found by Mac OS compiler (from Michael) 3) a couple of copyright updates on the effected files. MFC after: 3 months
* Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macrostuexen2010-12-301-2/+1
| | | | | | | and use them instead of the generic compare_with_wrap. Retire compare_with_wrap. MFC after: 3 months.
* Code cleanup: Use LIST_FOREACH, LIST_FOREACH_SAFE, TAILQ_FOREACH,tuexen2010-12-301-28/+9
| | | | | | | TAILQ_FOREACH_SAFE where appropriate. No functional change. MFC after: 3 months.
* Fix three bugs related to the sequence number wrap-around affectingtuexen2010-12-301-1/+1
| | | | | | | the processing of ECNE and ASCONF chunks. Reviewed by: rrs MFC after: 3 days.
* Delay the assignment of a path for DATA chunk until they hittuexen2010-09-151-45/+2
| | | | | | | the sent_queue. Honor a given path when the SCTP_ADDR_OVER flag is set. MFC after: 2 weeks.
* * Fix a bug where the length of the ASCONF-ACK was calculated wrong duetuexen2010-06-141-1/+3
| | | | | | | | | | | | | | to using an uninitialized variable. * Fix a bug where a NULL pointer was dereferenced when interfaces come and go at a high rate. * Fix a bug where inps where not deregistered from iterators. * Fix a race condition in freeing an association. * Fix a refcount problem related to the iterator. Each of the above bug results in a panic. It shows up when interfaces come and go at a high rate. Obtained from: rrs (partly) MFC after: 3 days
* * Fix compilation when using SCTP_AUDITING_ENABLED.tuexen2010-04-231-1/+1
| | | | | | | | | * Fix delaying of SACK by taking out old optimization code which does not optimize anymore. * Fix fast retransmission of chunks abandoned by the "number of retransmissions" policy. MFC after: 3 days.
* * Fix some race condition in SACK/NR-SACK processing.tuexen2010-04-031-5/+5
| | | | | | | | * 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.
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Do not start the iterator when there are no associations.tuexen2009-11-171-36/+38
| | | | | | | This fixes a bug found by Irene Ruengeler. Approved by: rrs (mentor) MFC after: 1 month
* Support for VNET in SCTP (hopefully)rrs2009-09-171-1/+1
|
* Code from the hack-session known as the IETF (and arrs2008-12-061-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* - Out with some printfs.rrs2008-07-291-8/+3
| | | | | | | - Fix a initialization of last_tsn_used - Fix handling of mapped IPv4 addresses Obtained from: Michael Tuexen and I :-) MFC after: 1 week
* 1) Adds the rest of the VIMAGE change macrosrrs2008-07-091-1/+3
| | | | | | | | | | | | 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-11/+11
| | | | | | | | | | | | | | | | | | - 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 :-)
* - Adds support for the multi-asconf (From Kozuka-san)rrs2008-05-201-55/+196
| | | | | | | | | | | | | | | | | | - 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-102/+138
| | | | | | PR: 116816 Obtained from tuexen@fh-muenster.de: MFC after: 2 weeks
* - Bug fix managing congestion parameter on immediaterrs2007-10-011-3/+10
| | | | | | | | | | | | | | | | | | | | 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)
* - The address lock is changed to a rwlock. Thisrrs2007-09-181-13/+10
| | | | | | | | | | | | | also involves macro changes to have a RLOCK and a WLOCK and placing the correct version within the code. - The INP-INFO lock is changed to a rwlock. - When sctp_shutdown() is called on Mac OS X, the socket lock is held. So call sctp_chunk_output with SCTP_SO_LOCKED and not SCTP_SO_NOT_LOCKED. - Add SCTP_IPI_ADDR_[RW]LOCK and SCTP_IPI_ADDR_[RW]UNLOCK for Mac OS X. - u_int64_t -> uint64_t - add missing addr unlock for error return path Approved by: re@freebsd.org (K Smith)
* - Get rid of unsused constants for sysctl variables.rrs2007-09-151-73/+76
| | | | | | | | | | | | | | - 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)
* - DF bit was on for COOKIE-ECHO chunks. This isrrs2007-09-131-9/+2
| | | | | | | | | | | | | incorrect and should be OFF letting IP fragment large cookie-echos. - Rename sysctl variable logging to log_level. - Fix description of sysctl variable stats. - Add sysctl variable log to make sctp_log readable via sysctl mechanism (this is by compile switch and targets non KTR platforms or when someone wants to do performance wise tracing). - Removed debug code Approved by: re@freebsd.org (B Mah)
* - Removed debug code and more C++ style comments in the mobilityrrs2007-09-101-14/+1
| | | | | code in sctp_asconf.c Approved by: re@freebsd.org (B Mah)
* - Added some comments to tell where the htcprrs2007-09-101-9/+8
| | | | | | | | | | code comes from. - Fix a LOR on Mac OS X: Do not hold an stcb lock when calling soisconnected for a socket which has the SS_INCOMP bit set on so_state. - fix a comment to be non c++ style. Approved by: re@freebsd.org (B Mah)
* - send call has a reference to uio->uio_resid inrrs2007-09-081-11/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the recent send code, but uio may be NULL on sendfile calls. Change to use sndlen variable. - EMSGSIZE is not being returned in non-blocking mode and needs a small tweak to look if the msg would ever fit when returning EWOULDBLOCK. - FWD-TSN has a bug in stream processing which could cause a panic. This is a follow on to the codenomicon fix. - PDAPI level 1 and 2 do not work unless the reader gets his returned buffer full. Fix so we can break out when at level 1 or 2. - Fix fast-handoff features to copy across properly on accepted sockets - Fix sctp_peeloff() system call when no true system call exists to screen arguments for errors. In cases where a real system call exists the system call itself does this. - Fix raddr leak in recent add-ip code change for bundled asconfs (even when non-bundled asconfs are received) - Make sure ipi_addr lock is held when walking global addr list. Need to change this lock type to a rwlock(). - Add don't wake flag on both input and output when the socket is closing. - When deleting an address verify the interface is correct before allowing the delete to process. This protects panda and unnumbered. - Clean up old sysctl stuff and get rid of the old Open/Net BSD structures. - Add a function to watch the ranges in the sysctl sets. - When appending in the reassembly queue, validate that the assoc has not gone to about to be freed. If so (in the middle) abort out. Note this especially effects MAC I think due to the lock/unlock they do (or with LOCK testing in place). - Netstat patch to get rid of warnings. - Make sure that no data gets queued to inactive/unconfirmed destinations. This especially effect CMT but also makes a impact on regular SCTP as well. - During init collision when we detect seq number out of sync we need to treat it like Case C and discard the cookie (no invarient needed here). - Atomic access to the random store. - When we declare a vtag good, we need to shove it into the time wait hash to prevent further use. When the tag is put into the assoc hash, we need to remove it from the twait hash (where it will surely be). This prevents duplicate tag assignments. - Move decr-ref count to better protect sysctl out of data. - ltrace error corrections in sctp6_usrreq.c - Add hook for interface up/down to be sent to us. - Make sysctl() exported structures independent of processor architecture. - Fix route and src addr cache clearing for delete address case. - Make sure address marked SCTP_DEL_IP_ADDRESS is never selected as src addr. - in icmp handling fixed so we actually look at the icmp codes to figure out what to do. - Modified mobility code. Reception of DELETE IP ADDRESS for a primary destination and SET PRIMARY for a new primary destination is used for retransmission trigger to the new primary destination. Also, in this case, destination of chunks in send_queue are changed to the new primary destination. - Fix so that we disallow sending by mbuf to ever have EEOR mode set upon it. Approved by: re@freebsd.org (B Mah)
* - Locking compatiability changes. This involves addingrrs2007-09-081-6/+6
| | | | | | | | | | | 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)
* - During shutdown pending, when the last sack came in andrrs2007-08-271-13/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
OpenPOWER on IntegriCloud