]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
sctp: fix the data size calculation in sctp_data_size
authorXin Long <lucien.xin@gmail.com>
Wed, 17 Oct 2018 13:11:27 +0000 (21:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2018 05:32:21 +0000 (22:32 -0700)
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 <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/sm.h

index 5ef1bad81ef54906b375dbfd0e4fd897d078abce..9e3d32746430cc1a93ab0c8c70a213d76f921d0b 100644 (file)
@@ -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;
 }