diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-12-08 14:04:02 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-11 17:23:04 +0100 |
commit | 668c9beb9020d5834ee9e43c208190a07d2b1928 (patch) | |
tree | 261f79e022a21f748425736b66ddcf7e42b9c00f /include/net/sctp/sm.h | |
parent | sctp: implement make_datafrag for sctp_stream_interleave (diff) | |
download | linux-668c9beb9020d5834ee9e43c208190a07d2b1928.tar.xz linux-668c9beb9020d5834ee9e43c208190a07d2b1928.zip |
sctp: implement assign_number for sctp_stream_interleave
assign_number is added as a member of sctp_stream_interleave, used
to assign ssn for data or mid (message id) for idata, called in
sctp_packet_append_data. sctp_chunk_assign_ssn is left as it is,
and sctp_chunk_assign_mid is added for sctp_stream_interleave_1.
This procedure is described in section 2.2.2 of RFC8260.
All sizeof(struct sctp_data_chunk) in tx path is replaced with
sctp_datachk_len, to make it right for idata as well. And also
adjust sctp_chunk_is_data for SCTP_CID_I_DATA.
After this patch, idata can be built and sent in tx path.
Note that if sp strm_interleave is set, it has to wait_connect in
sctp_sendmsg, as asoc intl_enable need to be known after 4 shake-
hands, to decide if it should use data or idata later. data and
idata can't be mixed to send in one asoc.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.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.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index f950186aae34..ca1db8997e5d 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -343,7 +343,7 @@ static inline __u16 sctp_data_size(struct sctp_chunk *chunk) __u16 size; size = ntohs(chunk->chunk_hdr->length); - size -= sizeof(struct sctp_data_chunk); + size -= sctp_datahdr_len(&chunk->asoc->stream); return size; } |