Skip to content

Commit

Permalink
sctp: fix the data size calculation in sctp_data_size
Browse files Browse the repository at this point in the history
[ Upstream commit 5660b9d ]

sctp data size should be calculated by subtracting data chunk header's
length from chunk_hdr->length, not just data header.

Fixes: 668c9be ("sctp: implement assign_number for sctp_stream_interleave")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
lxin authored and gregkh committed Nov 4, 2018
1 parent 81e31ab commit c1b1e96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/sctp/sm.h
Expand Up @@ -347,7 +347,7 @@ static inline __u16 sctp_data_size(struct sctp_chunk *chunk)
__u16 size;

size = ntohs(chunk->chunk_hdr->length);
size -= sctp_datahdr_len(&chunk->asoc->stream);
size -= sctp_datachk_len(&chunk->asoc->stream);

return size;
}
Expand Down

0 comments on commit c1b1e96

Please sign in to comment.