summaryrefslogtreecommitdiff
path: root/include/net/sctp/sm.h
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2018-10-17 16:11:27 +0300
committerDavid S. Miller <davem@davemloft.net>2018-10-18 08:32:21 +0300
commit5660b9d9d6a29c2c3cc12f62ae44bfb56b0a15a9 (patch)
tree50cedf7d6c8e57a558190dfff589bc25c9e553a2 /include/net/sctp/sm.h
parent05c998b738fdd3e5d6a257bcacc8f34b6284d795 (diff)
downloadlinux-5660b9d9d6a29c2c3cc12f62ae44bfb56b0a15a9.tar.xz
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 <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/sm.h')
-rw-r--r--include/net/sctp/sm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 5ef1bad81ef5..9e3d32746430 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;
}