diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-12-08 16:04:01 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-11 19:23:04 +0300 |
commit | 0c3f6f655487d12c7a0c16914c98c599043e88d3 (patch) | |
tree | 4fa938da18a6b9e40ac49382ad03359d412ef1b3 /include/net/sctp/sm.h | |
parent | ad05a7a05ede28ba6dd935d9e932264a22518b1f (diff) | |
download | linux-0c3f6f655487d12c7a0c16914c98c599043e88d3.tar.xz |
sctp: implement make_datafrag for sctp_stream_interleave
To avoid hundreds of checks for the different process on I-DATA chunk,
struct sctp_stream_interleave is defined as a group of functions used
to replace the codes in some place where it needs to do different job
according to if the asoc intl_enabled is set.
With these ops, it only needs to initialize asoc->stream.si with
sctp_stream_interleave_0 for normal data if asoc intl_enable is 0,
or sctp_stream_interleave_1 for idata if asoc intl_enable is set in
sctp_stream_init.
After that, the members in asoc->stream.si can be used directly in
some special places without checking asoc intl_enable.
make_datafrag is the first member for sctp_stream_interleave, it's
used to make data or idata frags, called in sctp_datamsg_from_user.
The old function sctp_make_datafrag_empty needs to be adjust some
to fit in this ops.
Note that as idata and data chunks have different length, it also
defines data_chunk_len for sctp_stream_interleave to describe the
chunk size.
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 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 5389ae034cfa..f950186aae34 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -199,10 +199,9 @@ struct sctp_chunk *sctp_make_cwr(const struct sctp_association *asoc, const struct sctp_chunk *chunk); struct sctp_chunk *sctp_make_idata(const struct sctp_association *asoc, __u8 flags, int paylen, gfp_t gfp); -struct sctp_chunk *sctp_make_datafrag_empty(struct sctp_association *asoc, +struct sctp_chunk *sctp_make_datafrag_empty(const struct sctp_association *asoc, const struct sctp_sndrcvinfo *sinfo, - int len, const __u8 flags, - __u16 ssn, gfp_t gfp); + int len, __u8 flags, gfp_t gfp); struct sctp_chunk *sctp_make_ecne(const struct sctp_association *asoc, const __u32 lowest_tsn); struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc); |