Skip to content

Commit

Permalink
sctp: do not update a_rwnd if we are not issuing a sack
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Mar 20, 2016
1 parent abbdb5a commit 07b4d6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/sctp/sm_sideeffect.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,14 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
} else {
__u32 old_a_rwnd = asoc->a_rwnd;

asoc->a_rwnd = asoc->rwnd;
sack = sctp_make_sack(asoc);
if (!sack)
if (!sack) {
asoc->a_rwnd = old_a_rwnd;
goto nomem;
}

asoc->peer.sack_needed = 0;
asoc->peer.sack_cnt = 0;
Expand Down

0 comments on commit 07b4d6a

Please sign in to comment.