From: Xin Long Date: Wed, 17 Oct 2018 13:11:27 +0000 (+0800) Subject: sctp: fix the data size calculation in sctp_data_size X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5660b9d9d6a29c2c3cc12f62ae44bfb56b0a15a9;p=linux.git sctp: fix the data size calculation in sctp_data_size sctp data size should be calculated by subtracting data chunk header's length from chunk_hdr->length, not just data header. Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller --- diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 5ef1bad81ef54..9e3d32746430c 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -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; }