diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2016-03-18 17:39:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-20 16:31:11 -0400 |
commit | 07b4d6a1749422fa1e054f3c2aba444acdba39e8 (patch) | |
tree | 6474dfe18a02acadb6a3fee23d2719af33601202 | |
parent | abbdb5a74cead60e20b79c960c1772955f0b6b81 (diff) |
sctp: do not update a_rwnd if we are not issuing a sack
The SACK can be lost pretty much elsewhere, but if its allocation fail,
we know we are not sending it, so it is better to revert a_rwnd to its
previous value as this may give it a chance to issue a window update
later.
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sctp/sm_sideeffect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 3c22c41a2bc2..7fe56d0acabf 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -215,10 +215,14 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force, | |||
215 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, | 215 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, |
216 | SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); | 216 | SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); |
217 | } else { | 217 | } else { |
218 | __u32 old_a_rwnd = asoc->a_rwnd; | ||
219 | |||
218 | asoc->a_rwnd = asoc->rwnd; | 220 | asoc->a_rwnd = asoc->rwnd; |
219 | sack = sctp_make_sack(asoc); | 221 | sack = sctp_make_sack(asoc); |
220 | if (!sack) | 222 | if (!sack) { |
223 | asoc->a_rwnd = old_a_rwnd; | ||
221 | goto nomem; | 224 | goto nomem; |
225 | } | ||
222 | 226 | ||
223 | asoc->peer.sack_needed = 0; | 227 | asoc->peer.sack_needed = 0; |
224 | asoc->peer.sack_cnt = 0; | 228 | asoc->peer.sack_cnt = 0; |