Make SCTP_MAX_BURST compliant with the latest version of

the socket API ID. This is not compatible with the API
in stable/8.
This commit is contained in:
Michael Tuexen 2011-01-26 19:55:54 +00:00
parent 90fed1d88e
commit 507c72969d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217895

View File

@ -1967,18 +1967,21 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
break;
case SCTP_MAX_BURST:
{
uint8_t *value;
struct sctp_assoc_value *av;
SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize);
SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize);
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
SCTP_INP_RLOCK(inp);
if (inp->sctp_ep.max_burst < 256) {
*value = inp->sctp_ep.max_burst;
if (stcb) {
av->assoc_value = stcb->asoc.max_burst;
SCTP_TCB_UNLOCK(stcb);
} else {
*value = 255;
SCTP_INP_RLOCK(inp);
av->assoc_value = inp->sctp_ep.max_burst;
SCTP_INP_RUNLOCK(inp);
}
SCTP_INP_RUNLOCK(inp);
*optsize = sizeof(uint8_t);
*optsize = sizeof(struct sctp_assoc_value);
}
break;
case SCTP_MAXSEG:
@ -3590,13 +3593,19 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
break;
case SCTP_MAX_BURST:
{
uint8_t *burst;
struct sctp_assoc_value *av;
SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize);
SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
SCTP_INP_WLOCK(inp);
inp->sctp_ep.max_burst = *burst;
SCTP_INP_WUNLOCK(inp);
if (stcb) {
stcb->asoc.max_burst = av->assoc_value;
SCTP_TCB_UNLOCK(stcb);
} else {
SCTP_INP_WLOCK(inp);
inp->sctp_ep.max_burst = av->assoc_value;
SCTP_INP_WUNLOCK(inp);
}
}
break;
case SCTP_MAXSEG: