From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Subject: Re: [PATCH net] sctp: fix the data size calculation in sctp_data_size Date: Wed, 17 Oct 2018 15:00:10 -0300 Message-ID: <20181017180010.GH6761@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: network dev , linux-sctp@vger.kernel.org, davem@davemloft.net, Neil Horman To: Xin Long Return-path: Received: from mail-qk1-f193.google.com ([209.85.222.193]:47067 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbeJRB5D (ORCPT ); Wed, 17 Oct 2018 21:57:03 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Oct 17, 2018 at 09:11:27PM +0800, Xin Long wrote: > 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 > --- > include/net/sctp/sm.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h > index 5ef1bad..9e3d327 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; > } > -- > 2.1.0 >