aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_statefuns.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-05-31 04:36:31 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-02 13:56:26 -0400
commitcee360ab4dd66fc1de33a5fa1cb418fa21c27ce3 (patch)
treedb9b8575e7392b314e94a946590b71bb5c856e64 /net/sctp/sm_statefuns.c
parent6e7da286e3513ac1e107ef8dffa5f254029d68e7 (diff)
sctp: define the member stream as an object instead of pointer in asoc
As Marcelo's suggestion, stream is a fixed size member of asoc and would not grow with more streams. To avoid an allocation for it, this patch is to define it as an object instead of pointer and update the places using it, also create sctp_stream_update() called in sctp_assoc_update() to migrate the stream info from one stream to another. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r--net/sctp/sm_statefuns.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index f863b5573e42..df73190da761 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3958,7 +3958,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(struct net *net,
3958 3958
3959 /* Silently discard the chunk if stream-id is not valid */ 3959 /* Silently discard the chunk if stream-id is not valid */
3960 sctp_walk_fwdtsn(skip, chunk) { 3960 sctp_walk_fwdtsn(skip, chunk) {
3961 if (ntohs(skip->stream) >= asoc->stream->incnt) 3961 if (ntohs(skip->stream) >= asoc->stream.incnt)
3962 goto discard_noforce; 3962 goto discard_noforce;
3963 } 3963 }
3964 3964
@@ -4029,7 +4029,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
4029 4029
4030 /* Silently discard the chunk if stream-id is not valid */ 4030 /* Silently discard the chunk if stream-id is not valid */
4031 sctp_walk_fwdtsn(skip, chunk) { 4031 sctp_walk_fwdtsn(skip, chunk) {
4032 if (ntohs(skip->stream) >= asoc->stream->incnt) 4032 if (ntohs(skip->stream) >= asoc->stream.incnt)
4033 goto gen_shutdown; 4033 goto gen_shutdown;
4034 } 4034 }
4035 4035
@@ -6365,7 +6365,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6365 * and discard the DATA chunk. 6365 * and discard the DATA chunk.
6366 */ 6366 */
6367 sid = ntohs(data_hdr->stream); 6367 sid = ntohs(data_hdr->stream);
6368 if (sid >= asoc->stream->incnt) { 6368 if (sid >= asoc->stream.incnt) {
6369 /* Mark tsn as received even though we drop it */ 6369 /* Mark tsn as received even though we drop it */
6370 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); 6370 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
6371 6371
@@ -6387,7 +6387,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6387 * and is invalid. 6387 * and is invalid.
6388 */ 6388 */
6389 ssn = ntohs(data_hdr->ssn); 6389 ssn = ntohs(data_hdr->ssn);
6390 if (ordered && SSN_lt(ssn, sctp_ssn_peek(asoc->stream, in, sid))) 6390 if (ordered && SSN_lt(ssn, sctp_ssn_peek(&asoc->stream, in, sid)))
6391 return SCTP_IERROR_PROTO_VIOLATION; 6391 return SCTP_IERROR_PROTO_VIOLATION;
6392 6392
6393 /* Send the data up to the user. Note: Schedule the 6393 /* Send the data up to the user. Note: Schedule the