Skip to content

Commit 07b4d6a

Browse files
marceloleitnerdavem330
authored andcommitted
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>
1 parent abbdb5a commit 07b4d6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/sctp/sm_sideeffect.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,14 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
215215
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
216216
SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
217217
} else {
218+
__u32 old_a_rwnd = asoc->a_rwnd;
219+
218220
asoc->a_rwnd = asoc->rwnd;
219221
sack = sctp_make_sack(asoc);
220-
if (!sack)
222+
if (!sack) {
223+
asoc->a_rwnd = old_a_rwnd;
221224
goto nomem;
225+
}
222226

223227
asoc->peer.sack_needed = 0;
224228
asoc->peer.sack_cnt = 0;

0 commit comments

Comments
 (0)