Commit 5660b9d9 authored by Xin Long's avatar Xin Long Committed by David S. Miller

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: 668c9beb ("sctp: implement assign_number for sctp_stream_interleave")
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05c998b7
...@@ -347,7 +347,7 @@ static inline __u16 sctp_data_size(struct sctp_chunk *chunk) ...@@ -347,7 +347,7 @@ static inline __u16 sctp_data_size(struct sctp_chunk *chunk)
__u16 size; __u16 size;
size = ntohs(chunk->chunk_hdr->length); size = ntohs(chunk->chunk_hdr->length);
size -= sctp_datahdr_len(&chunk->asoc->stream); size -= sctp_datachk_len(&chunk->asoc->stream);
return size; return size;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment