From ab8b39e9231b44619be4d302866e841987ed204a Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Tue, 8 Jul 2008 02:28:39 -0700 Subject: [PATCH] --- yaml --- r: 98823 b: refs/heads/master c: 3888e9efc9bf05e60504d2a420be7a527ff43678 h: refs/heads/master i: 98821: ae9204498f431b84ae07b499b9cac44df16f98b6 98819: 24ee6e2c4f13a86a162205163b6a55906cdbb658 98815: e5ca9c2bfc780becf3f3f16590e52105bd0525e5 v: v3 --- [refs] | 2 +- trunk/net/sctp/sm_statefuns.c | 9 +++------ trunk/net/sctp/ulpevent.c | 5 +++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 56fa70bc71d4..bc9ea51a629b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6e43829bb69bf1d584a592075f1357590eb49b1a +refs/heads/master: 3888e9efc9bf05e60504d2a420be7a527ff43678 diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c index 0c9d5a6950fe..fcdb45d1071b 100644 --- a/trunk/net/sctp/sm_statefuns.c +++ b/trunk/net/sctp/sm_statefuns.c @@ -5899,12 +5899,6 @@ static int sctp_eat_data(const struct sctp_association *asoc, return SCTP_IERROR_NO_DATA; } - /* If definately accepting the DATA chunk, record its TSN, otherwise - * wait for renege processing. - */ - if (SCTP_CMD_CHUNK_ULP == deliver) - sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); - chunk->data_accepted = 1; /* Note: Some chunks may get overcounted (if we drop) or overcounted @@ -5924,6 +5918,9 @@ static int sctp_eat_data(const struct sctp_association *asoc, * and discard the DATA chunk. */ if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) { + /* Mark tsn as received even though we drop it */ + sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); + err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, &data_hdr->stream, sizeof(data_hdr->stream)); diff --git a/trunk/net/sctp/ulpevent.c b/trunk/net/sctp/ulpevent.c index ce6cda6b6994..a1f654aea268 100644 --- a/trunk/net/sctp/ulpevent.c +++ b/trunk/net/sctp/ulpevent.c @@ -710,6 +710,11 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, if (!skb) goto fail; + /* Now that all memory allocations for this chunk succeeded, we + * can mark it as received so the tsn_map is updated correctly. + */ + sctp_tsnmap_mark(&asoc->peer.tsn_map, ntohl(chunk->subh.data_hdr->tsn)); + /* First calculate the padding, so we don't inadvertently * pass up the wrong length to the user. *