History log of /freebsd-10.3-release/lib/libc/net/sctp_sys_calls.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 296373 04-Mar-2016 marius

- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.3.
- Update default pkg(8) configuration to use the quarterly branch.

Approved by: re (implicit)

# 294911 27-Jan-2016 tuexen

MFC r294694:
sctp_sendx() needs to provide the assoc_id back.


# 294910 27-Jan-2016 tuexen

MFC r294688:
sctp_sendv() needs to fill in the association id on return.


# 283724 29-May-2015 tuexen

MFC r279859:

Add a SCTP socket option to limit the cwnd for each path.


# 283702 29-May-2015 tuexen

MFC r275857:

Initilize the msg_flags field consistently in all code paths.

Reported by: Coverity
CID: 1018726


# 283701 29-May-2015 tuexen

MFC r275682:

Fix a typo reported by Lennart Grahl.


# 270363 22-Aug-2014 tuexen

MFC r269945:

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.


# 270362 22-Aug-2014 tuexen

MFC r269858:

Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED
socket options. Add also a sysctl to control the support of ASCONF.


# 270361 22-Aug-2014 tuexen

MFC r269527:

Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding
sysctl controlling the negotiation of the RE-CONFIG extension.


# 270360 22-Aug-2014 tuexen

MFC r269481:

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.


# 270359 22-Aug-2014 tuexen

MFC r269475:

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.


# 270357 22-Aug-2014 tuexen

MFC r269448:

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.


# 270356 22-Aug-2014 tuexen

MFC r269436, r269445:

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.


# 260428 08-Jan-2014 tuexen

MFC r260257:

Fix several bugs in sctp_bindx():
* Set errno to EAFNOSUPPORT if an address is provided which is neither
AF_INET nor AF_INET6.
* Don't modify the arguments.
* Don't smash the stack when provided with a non-zero port.
* Handle the case correctly where the first address provided is
an IPv6 address.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255695 19-Sep-2013 tuexen

Remove an unused variable and fix a memory leak in sctp_connectx().

Approved by: re (gjb)
MFC after: 3 days


# 253105 09-Jul-2013 tuexen

Fix the handling of SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC in
sctp_opt_info().

MFC after: 3 days


# 253104 09-Jul-2013 tuexen

Fix a bug where SCTP_ENABLE_STREAM_RESET is not handled by
sctp_opt_info().

MFC after: 3 days


# 249333 10-Apr-2013 tuexen

Remove the number of addresses restriction from sctp_connectx().
Remove unused code.
While there, do some cleanup of the code.

MFC after: 1 week


# 246629 10-Feb-2013 tuexen

Improve code style. No functional change.

MFC after: 3 days


# 243302 19-Nov-2012 tuexen

Cleanup the code a bit, which improves the portability.
MFC after: 1 week


# 243300 19-Nov-2012 tuexen

Fix the handling of mapped IPv6 addresses in sctp_connectx().

MFC after: 3 days


# 242512 03-Nov-2012 tuexen

Fix errno in a couple of error cases.

MFC after: 3 days


# 235827 23-May-2012 tuexen

Update copyright date.

MFC after: 3 days


# 234997 04-May-2012 tuexen

Remove debug output.

MFC after: 3 days


# 228630 17-Dec-2011 tuexen

Address warnings found by clang.

MFC after: 3 months.


# 228531 15-Dec-2011 tuexen

Fix a bug where sctp_sendmdg() uses uninitialized memory.

MFC after: 3 days.


# 227755 20-Nov-2011 tuexen

Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.
Retire the the now unused sctp_udp_tunneling_for_client_enable
sysctl variable.

MFC after: 3 months.


# 224641 03-Aug-2011 tuexen

The result of a joint work between rrs@ and myself at the IETF:
* 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.


# 223180 17-Jun-2011 tuexen

Add SCTP_MAX_BURST support to sctp_opt_info().
This only applies to 9.0 and higher, since the type
of the values has changed since we introduced it.
So it can't be MFCed.


# 223178 17-Jun-2011 tuexen

Update the list of supported socket options for sctp_opt_info().

MFC after: 1 month.


# 223154 16-Jun-2011 tuexen

Fix two typos and remove redundant code.

MFC after: 1 month.


# 223152 16-Jun-2011 tuexen

* Fix the handling of addresses in sctp_sendv().
* Add support for SCTP_SENDV_NOINFO.
* Improve the error handling of sctp_sendv() and sctp_recv().

MFC after: 1 month


# 223132 15-Jun-2011 tuexen

Add support for the newly added SCTP API.
In particular add support for:
* SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and
SCTP_DSTADDRV6 cmsgs.
* SCTP_NXTINFO and SCTP_RCVINFO cmgs.
* SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO
socket option.
* Special association ids (SCTP_FUTURE_ASSOC, ...)
* sctp_recvv() and sctp_sendv() functions.

MFC after: 1 month.


# 221512 05-May-2011 tuexen

* Update copyright notice.
* Cleanup usage of iov's.
* Add support for SCTP_TIMEOUTS socketoption.
* Fix a bug in sctp_recvmsg(): return the msg_flags in case of an error.
* Fix a bug in the error handling of sctp_peeloff(): return the -1.


# 209760 07-Jul-2010 rrs

If a user calls sctp_sendx() with a NULL
sinfo we will crash. Instead we should provide
our own temp structure to use internally.

MFC after: 1 month


# 209709 05-Jul-2010 brucec

Increment 'sa' at the end of the loop; otherwise, only the first
address ever gets checked.

Approved by: rrs (mentor)
MFC after: 1 month


# 209684 04-Jul-2010 brucec

Use ISO C99 integer types instead of the BSD-specific u_int*_t.

Approved by: rrs (mentor)


# 203323 31-Jan-2010 brucec

Remove extra semicolon.

Approved by: rrs (mentor)


# 171572 24-Jul-2007 rrs

- take out a needless panic under invariants for sctp_output.c
- Fix addrs's error checking of sctp_sendx(3) when addrcnt is less than
SCTP_SMALL_IOVEC_SIZE
- re-add back inpcb_bind local address check bypass capability
- Fix it so sctp_opt_info is independant of assoc_id postion.
- Fix cookie life set to use MSEC_TO_TICKS() macro.
- asconf changes
o More comment changes/clarifications related to the old local address
"not" list which is now an explicit restricted list.

o Rename some functions for clarity:
- sctp_add/del_local_addr_assoc to xxx_local_addr_restricted()
- asconf related iterator functions to sctp_asconf_iterator_xxx()

o Fix bug when the same address is deleted and added (and removed from
the asconf queue) where the ifa is "freed" twice refcount wise,
possibly freeing it completely.

o Fix bug in output where the first ASCONF would not go out after the
last address is changed (e.g. only goes out when retransmitted).

o Fix bug where multiple ASCONFs can be bundled in the same packet with
the and with the same serial numbers.

o Fix asconf stcb iterator to not send ASCONF until after all work
queue entries have been processed.

o Change behavior so that when the last address is deleted (auto asconf
on a bound all endpoint) no action is taken until an address is
added; at that time, an ASCONF add+delete is sent (if the assoc
is still up).

o Fix local address counting so that address scoping is taken into
account.

o #ifdef SCTP_TIMER_BASED_ASCONF the old timer triggered sending
of ASCONF (after an RTO). The default now is to send
ASCONF immediately (except for the case of changing/deleting the
last usable address).
Approved by: re(ken smith)@freebsd.org


# 171440 14-Jul-2007 rrs

- Modular congestion control, with RFC2581 being the default.
- CMT_PF states added (w/sysctl to turn the PF version on)
- sctp_input.c had a missing incr of cookie case when the
auth was bad. This meant a free was called without an
increment to refcnt, added increment like rest of code.
- There was a case, unlikely, when the scope of the destination
changed (this is a TSNH case). In that case, it would not free
the alloc'ed asoc (in sctp_input.c).
- When listed addresses found a colliding cookie/Init, then
the collided upon tcb was not unlocked in sctp_pcb.c
- Add error checking on arguments of sctp_sendx(3) to prevent it from
referencing a NULL pointer.
- Fix an error return of sctp_sendx(3), it was returing
ENOMEM not -1.
- Get assoc id was changed to use the sanctified socket api
method for getting a assoc id (PEER_ADDR_INFO instead of
PEER_ADDR_PARAMS).
- Fix it so a peeled off socket will get a proper error return
if it trys to send to a different address then it is connected to.
- Fix so that select_a_stream can avoid an endless loop that
could hang a caller.
- time_entered (state set time) was not being set in all cases
to the time we went established.
Approved by: re(ken smith)


# 171152 02-Jul-2007 rrs

- Removes some incorrect error returns (errno was being overriden in
one of the functions)
- Fixes the error return of sctp_get_opt, it was returning the errno not
-1.
Approved by: re@freebsd.org (Robert Watson)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)


# 171039 26-Jun-2007 mjacob

Add missing semi-colon.

Approved by: re (not really, but it's better to have things compile than not for right now. Sorry)


# 171031 25-Jun-2007 rrs

- Fix wrong error return (the errno was being returned and not placed
in errno) - Found by Weongyo Jeong
- Remove two extra un-needed memset() after calloc()'s - Found by
Weongyo Jeong
- Tightened up parameter requirement checking on input to
bindx/connectx per socket api spec.
Approved by: re@freebsd.org(Ken Smith)


# 170993 22-Jun-2007 rrs

- Fix incorrect error return on sctp_getaddrlen
- Fix a memory leak when a non v4/v6 address was passed in.
- Take out strange line that copy's back to the src array
incorrectly (corrupting the input array).

Approved by: re(bmah@freebsd.org)
Obtained from: Weongyo Jeong(weongyo.jeong@gmail.com)


# 170580 11-Jun-2007 rrs

- Validate incoming addresses and sizes for connectx and bindx.
- For non-sys call version pass the msg_flags.


# 169623 16-May-2007 rrs

-Fix so getoptinfo() is in conformance with socket api (it
can be used on any read socketopt).
-Clean up of sendmsg call and make it conformant when no syscall
is available.


# 167598 15-Mar-2007 rrs

- Sysctl's move to seperate file
- moved away from ifn/ifa access to sctp_ifa/sctp_ifn
built and managed by the add-ip code.
- cleaned up add-ip code to use the iterator
- made iterator be a thread, which enables auto-asconf now.
- rewrote and cleaned up source address selection (also
made it use new structures).
- Fixed a couple of memory leaks.
- DACK now settable as to how many packets to delay as
well as time.
- connectx() to latest socket API, new associd arg.
- Fixed issue with revoking and loosing potential to
send when we inflate the flight size. We now inflate
the cwnd too and deflate it later when the revoked
chunk is sent or acked.
- Got rid of some temp debug code
- src addr selection moved to a common file (sctp_output.c)
- Support for simple VRF's (we have support for multi-vfr
via compile switch that is scrubbed from BSD but we won't
need multi-vrf until we first get VRF :-D)
- Rest of mib work for address information now done
- Limit number of addresses in INIT/INIT-ACK to
a #def (30).

Reviewed by: gnn


# 166887 22-Feb-2007 rrs

Fixes build breakage.. invalid type casts.. and invalid
type for size in one place.


# 166885 22-Feb-2007 rrs

Fixes __FreeBSD__ being present (they should not)
and also trailing garbage on undef of magic numbers.


# 166884 22-Feb-2007 rrs

Adds a performance improvement for when sctp_sendx is
called with only one address, we then can call the
generic system call. Also fixes some socket api
type issues and cleans up the "magic" numbers that
were being used in the code.

Reviewed by: gnn


# 165270 16-Dec-2006 rodrigc

Consistently use a socklen_t type where required, and eliminate
GCC warning "dereferencing type-punned pointer will
break strict-aliasing rules".

Reviewed by: rrs


# 165242 15-Dec-2006 rrs

This adds the "system calls"
sctp_getaddrlen()
sctp_connectx()
sctp_bindx()
sctp_opt_info()
sctp_getpaddrs()
sctp_freepaddrs()
sctp_getladdrs()
sctp_freeladdrs()
sctp_sendmsg()
sctp_getassocid()
sctp_send()
sctp_sendx()
sctp_sendmsgx()
sctp_recvmsg()
sctp_peeloff()

Manual pages will be forthcoming (and the commit to porters-handbook)