summaryrefslogtreecommitdiffstats
path: root/net/sctp/chunk.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-29 00:16:22 -0800
committerDavid S. Miller <davem@davemloft.net>2009-11-29 00:16:22 -0800
commit5656b6ca19c602a7074effae360e5a4dcfdc8170 (patch)
tree13eb8138999a3c6a8e6f92fb98b0cc54b7240c6a /net/sctp/chunk.c
parentc1ac403bfa240617da2bce861ea5c3a907a65612 (diff)
parent4814326b59db0cfd18ac652626d955ad3f57fb0f (diff)
Merge branch 'net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vxy/lksctp-dev
Diffstat (limited to 'net/sctp/chunk.c')
-rw-r--r--net/sctp/chunk.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index acf7c4d128f..8e4320040f0 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -263,9 +263,18 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
if (0 == i)
frag |= SCTP_DATA_FIRST_FRAG;
- if ((i == (whole - 1)) && !over)
+ if ((i == (whole - 1)) && !over) {
frag |= SCTP_DATA_LAST_FRAG;
+ /* The application requests to set the I-bit of the
+ * last DATA chunk of a user message when providing
+ * the user message to the SCTP implementation.
+ */
+ if ((sinfo->sinfo_flags & SCTP_EOF) ||
+ (sinfo->sinfo_flags & SCTP_SACK_IMMEDIATELY))
+ frag |= SCTP_DATA_SACK_IMM;
+ }
+
chunk = sctp_make_datafrag_empty(asoc, sinfo, len, frag, 0);
if (!chunk)
@@ -297,6 +306,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
else
frag = SCTP_DATA_LAST_FRAG;
+ if ((sinfo->sinfo_flags & SCTP_EOF) ||
+ (sinfo->sinfo_flags & SCTP_SACK_IMMEDIATELY))
+ frag |= SCTP_DATA_SACK_IMM;
+
chunk = sctp_make_datafrag_empty(asoc, sinfo, over, frag, 0);
if (!chunk)