I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
45 lines
2 KiB
Diff
45 lines
2 KiB
Diff
Index: sys/netinet/sctp_usrreq.c
|
|
===================================================================
|
|
--- sys/netinet/sctp_usrreq.c (revision 277788)
|
|
+++ sys/netinet/sctp_usrreq.c (working copy)
|
|
@@ -1863,8 +1863,9 @@ flags_out:
|
|
SCTP_CHECK_AND_CAST(av, optval, struct sctp_stream_value, *optsize);
|
|
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
|
|
if (stcb) {
|
|
- if (stcb->asoc.ss_functions.sctp_ss_get_value(stcb, &stcb->asoc, &stcb->asoc.strmout[av->stream_id],
|
|
- &av->stream_value) < 0) {
|
|
+ if ((av->stream_id >= stcb->asoc.streamoutcnt) ||
|
|
+ (stcb->asoc.ss_functions.sctp_ss_get_value(stcb, &stcb->asoc, &stcb->asoc.strmout[av->stream_id],
|
|
+ &av->stream_value) < 0)) {
|
|
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
|
error = EINVAL;
|
|
} else {
|
|
@@ -4032,8 +4033,9 @@ sctp_setopt(struct socket *so, int optname, void *
|
|
SCTP_CHECK_AND_CAST(av, optval, struct sctp_stream_value, optsize);
|
|
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
|
|
if (stcb) {
|
|
- if (stcb->asoc.ss_functions.sctp_ss_set_value(stcb, &stcb->asoc, &stcb->asoc.strmout[av->stream_id],
|
|
- av->stream_value) < 0) {
|
|
+ if ((av->stream_id >= stcb->asoc.streamoutcnt) ||
|
|
+ (stcb->asoc.ss_functions.sctp_ss_set_value(stcb, &stcb->asoc, &stcb->asoc.strmout[av->stream_id],
|
|
+ av->stream_value) < 0)) {
|
|
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
|
error = EINVAL;
|
|
}
|
|
@@ -4043,10 +4045,12 @@ sctp_setopt(struct socket *so, int optname, void *
|
|
SCTP_INP_RLOCK(inp);
|
|
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
|
|
SCTP_TCB_LOCK(stcb);
|
|
- stcb->asoc.ss_functions.sctp_ss_set_value(stcb,
|
|
- &stcb->asoc,
|
|
- &stcb->asoc.strmout[av->stream_id],
|
|
- av->stream_value);
|
|
+ if (av->stream_id < stcb->asoc.streamoutcnt) {
|
|
+ stcb->asoc.ss_functions.sctp_ss_set_value(stcb,
|
|
+ &stcb->asoc,
|
|
+ &stcb->asoc.strmout[av->stream_id],
|
|
+ av->stream_value);
|
|
+ }
|
|
SCTP_TCB_UNLOCK(stcb);
|
|
}
|
|
SCTP_INP_RUNLOCK(inp);
|