Date: Wed, 26 Jan 2011 19:55:54 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217895 - head/sys/netinet Message-ID: <201101261955.p0QJtssi087738@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Wed Jan 26 19:55:54 2011 New Revision: 217895 URL: http://svn.freebsd.org/changeset/base/217895 Log: Make SCTP_MAX_BURST compliant with the latest version of the socket API ID. This is not compatible with the API in stable/8. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:49:03 2011 (r217894) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:55:54 2011 (r217895) @@ -1967,18 +1967,21 @@ flags_out: 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 optna 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101261955.p0QJtssi087738>