summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/sctp6_usrreq.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r295549:tuexen2016-02-251-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loopback addresses are 127.0.0.0/8, not 127.0.0.1/32. MFC r295668: Improve the teardown of the SCTP stack. MFC r295670: Whitespace changes. MFC r295708: Address a warning reported by D5245 / PVS. MFC r295709: Code cleanup which will silence a warning in PVS / D5245. MFC r295710: Add protection code for issues reported by PVS / D5245. MFC r295771: Fix reporting of mapped addressed in getpeername() and getsockname() for IPv6 SCTP sockets. This bugs were found because of an issue reported by PVS / D5245. MFC r295772: Add some protection code. MFC r295773: Add protection code. MFC r295805: Use the SCTP level pointer, not the interface level. MFC r295929: Don't leak an address in an error path. Approved by: re (marius)
* MFC r291904:tuexen2016-01-171-1/+1
| | | | | | | | | Fix the allocation of outgoing streams: * When processing a cookie, use the number of streams announced in the INIT-ACK. * When sending an INIT-ACK for an existing association, use the value from the association, not from the end-point.
* MFC r285877:tuexen2016-01-161-4/+1
| | | | | | Move including netinet/icmp6.h around to avoid a problem when including netinet/icmp6.h and net/netmap.h. Both use ni_flags... This allows to build multistack with SCTP support.
* o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]glebius2016-01-141-1/+4
| | | | | | | | | | | | | o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux] o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux] o Fix TCP MD5 signature denial of service. [SA-16:05.tcp] o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd] Security: FreeBSD-SA-16:01.sctp, CVE-2016-1879 Security: FreeBSD-SA-16:03.linux, CVE-2016-1880 Security: FreeBSD-SA-16:04.linux, CVE-2016-1881 Security: FreeBSD-SA-16:05.tcp, CVE-2016-1882 Security: FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677
* MFC r284515:tuexen2015-06-201-1/+3
| | | | | | | Add FIB support for SCTP. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200379 PR: 200379
* MFC r283650:tuexen2015-05-311-2/+4
| | | | | Fix and cleanup the debug information. This has no user-visible changes. Thanks to Irene Ruengeler for proving a patch.
* MFC r276914:tuexen2015-05-291-7/+1
| | | | | Minimize the usage of SCTP_BUF_IS_EXTENDED. This should help Robert...
* MFC r275868:tuexen2015-05-291-1/+4
| | | | | | | Plug a memory leak in an error code path. Reported by: Coverity CID: 1018936
* MFC r275358 r275483 r276982 - Removing M_FLOWID by hps@hiren2015-04-241-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r275358: Start process of removing the use of the deprecated "M_FLOWID" flag from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. r275483: Remove M_FLOWID from SCTP code. r276982: Remove no longer used "M_FLOWID" flag from mbuf.h and update the netisr manpage. Note: The FreeBSD version has been bumped. Reviewed by: hps, tuexen Sponsored by: Limelight Networks
* MFC r270673:tuexen2014-09-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Announce SCTP support in the kern.features sysctl variables. MFC r270859: Enable SCTP support. It runs perfectly fine on a Wandboard quad. MFC r271204 with manual intervention: Fix the handling of sysctl variables when used with VIMAGE. While there do some cleanup of the code. MFC r271209: Fix a leak of an address, if the address is scheduled for removal and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC r271219: Use SYSCTL_PROC instead of SYSCTL_VNET_PROC. Suggested by: glebius@ MFC r271221: Use union sctp_sockstore instead of struct sockaddr_storage. This eliminates some warnings when building in userland. Thanks to Patrick Laimbock for reporting this issue. Remove also some unnecessary casts. There should be no functional change. MFC r271228: Address another warnings reported by Patrick Laimbock when compiling in userspace. While there, improve consistency. MFC r271230: Address warnings generated by the clang analyzer. Approved by: re (kib)
* MFC r256556:tuexen2013-11-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a buggy comparision when setting manually the path MTU. After fixing, the comparision would have become redundant. Thanks to Andrew Galante for reporting the issue. MFC r257272: Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined. The issue was reported by Andrew Galante. MFC r257274: Fix the value of *optlen when calling getsockopt() for SCTP_REMOTE_UDP_ENCAPS_PORT. This issue was reported by Andrew Galante. MFC r257359: Terminate a debug output with a \n. MFC r257555: Changes from upstream to improve compilation when INET or INET6 or none of them is defined. MFC r257574: Unlock the lock before destroying it. This issue was reported by Andrew Galante. MFC r257800: Use htons()/ntohs() appropriately. These issues were reported by Andrew Galante. MFC r257803: Make sure that we don't try to build an ASCONF-ACK chunk larger than what fits in the the mbuf cluster. This issue was reported by Andrew Galante. MFC r257804: Get rid of the artification limitation enforced by SCTP_AUTH_RANDOM_SIZE_MAX. This was suggested by Andrew Galante. MFC r258221: Cleanups which result in fixes which have been made upstream and where partially suggested by Andrew Galante. There is no functional change in FreeBSD. MFC r258224: When determining if an address belongs to an stcb, take the address family into account for wildcard bound endpoints. MFC r258228: Remove a stray write operation. MFC r258235: Use SCTP_PR_SCTP_TTL when the user provides a positive timetolive in sctp_sendmsg(). Approved by: re@
* Provide human readable debug output.tuexen2013-08-251-2/+2
|
* For now limit printf(9) %x of the 64bit pkthdr.csum_flags field to 32bits.andre2013-08-251-1/+1
| | | | | | The upper 32bits are not occupied for now. Sponsored by: The FreeBSD Foundation
* Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLYtuexen2013-05-101-22/+7
| | | | | | | socket option for SCTP sockets in the same way as for UDP or TCP sockets. MFC after: 2 weeks
* Add support for SCTP/UDP/IPV6.tuexen2012-11-171-2/+7
| | | | | | | This completes the support of http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-udp-encaps MFC after: 1 week
* Changes which improve compilation if neither INET nor INET6 is defined.tuexen2012-07-151-0/+3
| | | | MFC after: 3 days
* #ifdef INET and INET6 consistently. This also fixes a bug, wheretuexen2012-07-151-2/+2
| | | | | | it was done wrong. MFC after: 3 days
* Move common code parts to sctp_common_input_processing().tuexen2012-07-021-146/+28
| | | | MFC after: 3 days
* Pass the src and dst address of a received packet explicitly around.tuexen2012-06-281-9/+37
| | | | MFC after: 3 days
* Unify sctp_input() and sctp6_input().tuexen2012-06-251-105/+79
| | | | MFC after: 3 days
* Whitespace cleanup.tuexen2012-06-251-3/+3
| | | | MFC after: 3 days
* Pass the packet length explicitly around.tuexen2012-06-241-1/+1
| | | | MFC after: 3 days
* Do packet logging in a consistent way.tuexen2012-06-241-3/+5
| | | | MFC after: 3 days
* Pass flowid explicitly through the stack instead of taking it fromtuexen2012-06-141-7/+22
| | | | | | | the mbuf chain at different places. While there: Fix several bugs related to VRFs. MFC after: 3 days
* Get rid of SCTP specific code to avoid CRC32C computations on loopback.tuexen2012-05-261-5/+0
| | | | | Just just offloading. MFC after: 3 days
* Use consistent text at the begining of the files.tuexen2012-05-231-3/+2
| | | | MFC after: 3 days
* Missed to commit this in r235414.tuexen2012-05-131-2/+1
| | | | MFC after: 3 days
* Use ECONNABORTED in cases where the ABORT was sent to the peer.tuexen2012-05-131-1/+1
| | | | MFC after: 3 days
* Provide in the association change notification the received ABORT chunktuexen2012-05-121-5/+2
| | | | | | if case of SCTP_COMM_LOST or SCTP_CANT_STR_ASSOC as required by RFC 6458. MFC after: 3 days
* Clean up, no functional change.tuexen2012-03-151-3/+3
| | | | MFC after: 3 days.
* Remove two clang warnings.tuexen2012-02-181-1/+1
| | | | MFC after: 1 month.
* Add an SCTP sysctl "blackhole", similar to the one for TCP.tuexen2012-01-081-2/+7
| | | | | | | | | | If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. MFC after: 1 month.
* Address issues found by clang. While there, fix also some styletuexen2011-12-271-47/+39
| | | | | | issues. MFC after: 3 months.
* Fix unused parameter warnings.tuexen2011-12-171-8/+8
| | | | | | While there, fix some whitespace issues. MFC after: 3 months.
* The result of a joint work between rrs@ and myself at the IETF:tuexen2011-08-031-26/+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.
* Remove code with any effect.tuexen2011-05-031-3/+1
|
* Improve compilation of SCTP code without INET support.tuexen2011-04-301-40/+90
| | | | | | | | | | | | | | 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
* Fix bugs related to M_FLOWID:tuexen2011-02-071-0/+12
| | | | | | | | * Store the flowid when receiving an SCTP/IPv6 packet. * Store the flowid when receiving an SCTP packet with wrong CRC. * Initilize flowid correctly. * Put test code under INVARIANTS. MFC after: 3 months.
* 1) Typo correction in comments and one spacing change.rrs2011-02-051-0/+2
| | | | | 2) Mass update to all copyrights. MFC after: 3 Months
* Improve plausibility check in sctp_handle_sack().tuexen2010-12-221-1/+1
| | | | | | Allow cmt_on_off to support values 0 (no CMT), 1 (CMT), and 2 (CMT/RP). MFC after: 3 months.
* Remove unused variables.tuexen2010-09-151-3/+5
| | | | MFC after: 2 weeks.
* Fix the the SCTP_WITH_NO_CSUM option when used in combination withtuexen2010-08-291-1/+9
| | | | | | | interface supporting CRC offload. While at it, make use of the feature that the loopback interface provides CRC offloading. MFC after: 4 weeks
* Fix the switching on/off of CMT using sysctl and socket option.tuexen2010-08-281-1/+6
| | | | | | | | Fix the switching on/off of PF and NR-SACKs using sysctl. Add minor improvement in handling malloc failures. Improve the address checks when sending. MFC after: 4 weeks
* * Fix some race condition in SACK/NR-SACK processing.tuexen2010-04-031-1/+1
| | | | | | | | * 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.
* Support for VNET in SCTP (hopefully)rrs2009-09-171-4/+4
|
* - Cleanup checksum code.rrs2009-02-031-4/+17
| | | | | | | | | | | | | | | | | - 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-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 1) Adds the rest of the VIMAGE change macrosrrs2008-07-091-4/+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!
* - Macro-izes the packed declaration in all headers.rrs2008-06-141-6/+20
| | | | | | | | | | | | | | | | | | - 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-3/+3
| | | | | | | | | | | | | | | | | | - 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
OpenPOWER on IntegriCloud