diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /net/sctp/chunk.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'net/sctp/chunk.c')
-rw-r--r-- | net/sctp/chunk.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index acf7c4d128f7..3eab6db59a37 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/net.h> | 42 | #include <linux/net.h> |
43 | #include <linux/inet.h> | 43 | #include <linux/inet.h> |
44 | #include <linux/skbuff.h> | 44 | #include <linux/skbuff.h> |
45 | #include <linux/slab.h> | ||
45 | #include <net/sock.h> | 46 | #include <net/sock.h> |
46 | #include <net/sctp/sctp.h> | 47 | #include <net/sctp/sctp.h> |
47 | #include <net/sctp/sm.h> | 48 | #include <net/sctp/sm.h> |
@@ -263,9 +264,18 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, | |||
263 | if (0 == i) | 264 | if (0 == i) |
264 | frag |= SCTP_DATA_FIRST_FRAG; | 265 | frag |= SCTP_DATA_FIRST_FRAG; |
265 | 266 | ||
266 | if ((i == (whole - 1)) && !over) | 267 | if ((i == (whole - 1)) && !over) { |
267 | frag |= SCTP_DATA_LAST_FRAG; | 268 | frag |= SCTP_DATA_LAST_FRAG; |
268 | 269 | ||
270 | /* The application requests to set the I-bit of the | ||
271 | * last DATA chunk of a user message when providing | ||
272 | * the user message to the SCTP implementation. | ||
273 | */ | ||
274 | if ((sinfo->sinfo_flags & SCTP_EOF) || | ||
275 | (sinfo->sinfo_flags & SCTP_SACK_IMMEDIATELY)) | ||
276 | frag |= SCTP_DATA_SACK_IMM; | ||
277 | } | ||
278 | |||
269 | chunk = sctp_make_datafrag_empty(asoc, sinfo, len, frag, 0); | 279 | chunk = sctp_make_datafrag_empty(asoc, sinfo, len, frag, 0); |
270 | 280 | ||
271 | if (!chunk) | 281 | if (!chunk) |
@@ -297,6 +307,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, | |||
297 | else | 307 | else |
298 | frag = SCTP_DATA_LAST_FRAG; | 308 | frag = SCTP_DATA_LAST_FRAG; |
299 | 309 | ||
310 | if ((sinfo->sinfo_flags & SCTP_EOF) || | ||
311 | (sinfo->sinfo_flags & SCTP_SACK_IMMEDIATELY)) | ||
312 | frag |= SCTP_DATA_SACK_IMM; | ||
313 | |||
300 | chunk = sctp_make_datafrag_empty(asoc, sinfo, over, frag, 0); | 314 | chunk = sctp_make_datafrag_empty(asoc, sinfo, over, frag, 0); |
301 | 315 | ||
302 | if (!chunk) | 316 | if (!chunk) |