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
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>
  • Loading branch information
lxin authored and davem330 committed Oct 18, 2018
1 parent 05c998b commit 5660b9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/sctp/sm.h
Original file line number Diff line number Diff line change
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 5660b9d

Please sign in to comment.