svn commit: r300733 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Thu May 26 11:38:27 UTC 2016
Author: tuexen
Date: Thu May 26 11:38:26 2016
New Revision: 300733
URL: https://svnweb.freebsd.org/changeset/base/300733
Log:
Make struct sctp_paddrthlds compliant to RFC 7829.
Modified:
head/sys/netinet/sctp_uio.h
head/sys/netinet/sctp_usrreq.c
Modified: head/sys/netinet/sctp_uio.h
==============================================================================
--- head/sys/netinet/sctp_uio.h Thu May 26 11:12:36 2016 (r300732)
+++ head/sys/netinet/sctp_uio.h Thu May 26 11:38:26 2016 (r300733)
@@ -590,6 +590,7 @@ struct sctp_paddrthlds {
sctp_assoc_t spt_assoc_id;
uint16_t spt_pathmaxrxt;
uint16_t spt_pathpfthld;
+ uint16_t spt_pathcpthld;
};
struct sctp_paddrinfo {
Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c Thu May 26 11:12:36 2016 (r300732)
+++ head/sys/netinet/sctp_usrreq.c Thu May 26 11:38:26 2016 (r300733)
@@ -3304,9 +3304,11 @@ flags_out:
if (net != NULL) {
thlds->spt_pathmaxrxt = net->failure_threshold;
thlds->spt_pathpfthld = net->pf_threshold;
+ thlds->spt_pathcpthld = 0xffff;
} else {
thlds->spt_pathmaxrxt = stcb->asoc.def_net_failure;
thlds->spt_pathpfthld = stcb->asoc.def_net_pf_threshold;
+ thlds->spt_pathcpthld = 0xffff;
}
thlds->spt_assoc_id = sctp_get_associd(stcb);
SCTP_TCB_UNLOCK(stcb);
@@ -3318,6 +3320,7 @@ flags_out:
SCTP_INP_RLOCK(inp);
thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure;
thlds->spt_pathpfthld = inp->sctp_ep.def_net_pf_threshold;
+ thlds->spt_pathcpthld = 0xffff;
SCTP_INP_RUNLOCK(inp);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
@@ -6345,6 +6348,11 @@ sctp_setopt(struct socket *so, int optna
break;
}
}
+ if (thlds->spt_pathcpthld != 0xffff) {
+ error = EINVAL;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ break;
+ }
if (stcb != NULL) {
if (net != NULL) {
net->failure_threshold = thlds->spt_pathmaxrxt;
More information about the svn-src-all
mailing list