summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctputil.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r295549:tuexen2016-02-251-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r293828:tuexen2016-01-171-8/+9
| | | | | Store the timer type for logging, because the timer can be freed during processing the timerout.
* MFC r291904:tuexen2016-01-171-2/+2
| | | | | | | | | 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 r291364:tuexen2016-01-161-0/+12
| | | | | | | | | When receiving an SCTP/UDP packet and the interface performed the UDP checksum computation and signals that it was OK, clear this bit when passing the packet to SCTP. Since the bits indicating a valid UDP checksum and a valid SCTP checksum are the same, the SCTP stack would assume that also an SCTP checksum check has been performed.
* MFC r290442:tuexen2016-01-161-14/+14
| | | | | | Fix typos in field names of struct sctp_extrcvinfo. Provide defines to allow applications to compile. Thanks to Jens Hoelscher for making me aware of the typos.
* MFC r289570:tuexen2016-01-161-4/+4
| | | | | | | Use __func__ instead of __FUNCTION__. This allows to compile the userland stack without errors using gcc5. Thanks to saghul for makeing me aware and providing the patch.
* MFC r287456:tuexen2016-01-161-0/+3
| | | | Add a NULL pointer check to silence the clang code analyzer.
* MFC r287294:tuexen2016-01-161-1/+5
| | | | | | Use 5 times RTO.Max as the default for the shutdown guard timer as required by RFC 4960. The sysctl variable can be used to overwrite this.
* MFC r287282:tuexen2016-01-161-0/+43
| | | | | Fix the exporting of SCTP association states to userland. Without this, associations in SHUTDOWN-PENDING were never reported correctly.
* MFC r285925:tuexen2016-01-161-1/+4
| | | | Provide consistent error causes whenever an ABORT chunk is sent.
* MFC r285792:tuexen2016-01-161-1/+2
| | | | | | | | Fix several problems with Stream Reset. 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.
* MFC r284515:tuexen2015-06-201-4/+4
| | | | | | | Add FIB support for SCTP. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200379 PR: 200379
* MFC r283654:tuexen2015-05-311-10/+20
| | | | Some more debug info cleanup.
* MFC r283650:tuexen2015-05-311-4/+4
| | | | | Fix and cleanup the debug information. This has no user-visible changes. Thanks to Irene Ruengeler for proving a patch.
* MFC r283648:tuexen2015-05-311-3/+2
| | | | Address some compiler warnings. No functional change.
* MFC r280439:tuexen2015-05-291-6/+2
| | | | | Fix an accounting bug related to the per stream chunk counter. While there, don't refer to a net articifically.
* MFC r279867:tuexen2015-05-291-8/+12
| | | | | Keep track on the socket lock state. This fixes a bug showing up on Mac OS X.
* MFC r279859:tuexen2015-05-291-0/+1
| | | | Add a SCTP socket option to limit the cwnd for each path.
* MFC r277049:tuexen2015-05-291-10/+0
| | | | | | | Remove dead code. Reported by: Coverity CID: 1018052
* MFC r276914:tuexen2015-05-291-4/+18
| | | | | Minimize the usage of SCTP_BUF_IS_EXTENDED. This should help Robert...
* MFC r276009:tuexen2015-05-291-12/+3
| | | | | | | Don't check twice that inp is not NULL. Reported by: Coverity CID: 748671
* MFC r275567:tuexen2015-05-291-27/+45
| | | | | | Fix the support of mapped IPv4 addresses. Thanks to Mark Bonnekessel and Markus Boese for making me aware of the problems.
* MFC r275358 r275483 r276982 - Removing M_FLOWID by hps@hiren2015-04-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r272886:bryanv2015-01-271-3/+4
| | | | | | | | Add context pointer and source address to the UDP tunnel callback These are needed for the forthcoming vxlan implementation. The context pointer means we do not have to use a spare pointer field in the inpcb, and the source address is required to populate vxlan's forwarding table.
* MFC r271643:tuexen2014-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC r271665: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC r271670: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC r271672: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC r271673: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC r271674: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. Approved by: re (kib)
* MFC r270673:tuexen2014-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r269945:tuexen2014-08-221-0/+33
| | | | | | | | Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase.
* MFC r269858:tuexen2014-08-221-6/+8
| | | | | Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED socket options. Add also a sysctl to control the support of ASCONF.
* MFC r269527:tuexen2014-08-221-1/+2
| | | | | Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding sysctl controlling the negotiation of the RE-CONFIG extension.
* MFC r269481:tuexen2014-08-221-1/+1
| | | | | | Add support for the SCTP_PKTDROP_SUPPORTED socket option and the corresponding sysctl variable. The default is off, since the specification is not an RFC yet.
* MFC r269475:tuexen2014-08-221-1/+1
| | | | | | | Add SCTP socket option SCTP_NRSACK_SUPPORTED to control the NRSACK extension. The default will still be off, since it it not an RFC (yet). Changing the sysctl name will be in a separate commit.
* MFC r269448:tuexen2014-08-221-1/+2
| | | | | | Add support for the SCTP_PR_SUPPORTED socket option as specified in http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-prpolicies Add also a sysctl controlling the default of the end-points.
* MFC r269436, r269445:tuexen2014-08-221-1/+1
| | | | | | | | Cleanup the ECN configuration handling and provide an SCTP socket option for controlling ECN on future associations and get the status on current associations. A simialar pattern will be used for controlling SCTP extensions in upcoming commits.
* MFC r269376:tuexen2014-08-221-35/+20
| | | | | Cleanup sctp_send_initiate() and sctp_send_initiate_ack() to be in sync as much as possible. This simplifies upcoming changes.
* MFC r269075:tuexen2014-08-221-0/+2
| | | | | Initialize notification structures. This was missed in an earlier commit
* Fix kernel memory disclosure in control message and SCTP notifications.delphij2014-07-081-27/+28
| | | | | Security: FreeBSD-SA-14:17.kmem Security: CVE-2014-3952, CVE-2014-3953
* MFC r267674:tuexen2014-06-231-0/+8
| | | | | | | | | Honor jails for unbound SCTP sockets when selecting source addresses, reporting IP-addresses to the peer during the handshake, adding addresses to the host, reporting the addresses via the sysctl interface (used by netstat, for example) and reporting the addresses to the application via socket options. This issue was reported by Bernd Walter.
* MFC r264701:tuexen2014-06-221-3/+0
| | | | | Send also a packet containing an ABORT chunk in response to an OOTB packet containing a COOKIE-ECHO chunk.
* MFC r264679:tuexen2014-06-221-0/+19
| | | | | Send the correct error cause, when a DATA chunk with no user data is received. This bug was reported by Irene Ruengeler.
* MFC r263237:tuexen2014-06-221-11/+17
| | | | | | | | | | * Provide information in error causes in ASCII instead of proprietary binary format. * Add support for a diagnostic information error cause. The code is sysctlable and the default is 0, which means it is not sent. This is joint work with rrs@.
* MFC r259943:tuexen2014-01-071-2/+2
| | | | Address some warnings which showed up on the userland version.
* MFC r256556:tuexen2013-11-211-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Remove redundant field pr_sctp_on.tuexen2013-09-031-1/+0
| | | | MFC after: 1 week
* Use LIST_EMPTY when appropriate.tuexen2013-06-021-2/+2
| | | | MFC after: 1 week
* Remove redundant checks.tuexen2013-05-281-6/+6
| | | | MFC after: 2 weeks
* Set errno to ETIMEDOUT if an SCTP association times out duringtuexen2013-05-171-2/+8
| | | | | | setup. MFC after: 1 week
* Fix a potential race in returning setting errno when antuexen2013-02-271-1/+2
| | | | | | | | association goes down. Reported by Mozilla in https://bugzilla.mozilla.org/show_bug.cgi?id=845513 MFC after: 3 days
* Cleanup the handling of address scopes. Announce in the INIT/INIT-ACKtuexen2013-02-091-70/+55
| | | | | | | only the supported address types. While there, do some whitespace cleanups. MFC after: 1 week
* Fix a copy and paste error.tuexen2012-12-271-1/+1
| | | | MFC after: 3 days
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-051-17/+17
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
OpenPOWER on IntegriCloud