Skip to content

Commit 6bec041

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: fix bogus receive window shrinkage with multiple subflows
In case multiple subflows race to update the mptcp-level receive window, the subflow losing the race should use the window value provided by the "winning" subflow to update it's own tcp-level rcv_wnd. To such goal, the current code bogusly uses the mptcp-level rcv_wnd value as observed before the update attempt. On unlucky circumstances that may lead to TCP-level window shrinkage, and stall the other end. Address the issue feeding to the rcv wnd update the correct value. Fixes: f3589be ("mptcp: never shrink offered window") Cc: [email protected] Closes: multipath-tcp/mptcp_net-next#427 Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8a47558 commit 6bec041

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/mptcp/options.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,12 +1269,13 @@ static void mptcp_set_rwin(struct tcp_sock *tp, struct tcphdr *th)
12691269

12701270
if (rcv_wnd == rcv_wnd_old)
12711271
break;
1272-
if (before64(rcv_wnd_new, rcv_wnd)) {
1272+
1273+
rcv_wnd_old = rcv_wnd;
1274+
if (before64(rcv_wnd_new, rcv_wnd_old)) {
12731275
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDCONFLICTUPDATE);
12741276
goto raise_win;
12751277
}
12761278
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDCONFLICT);
1277-
rcv_wnd_old = rcv_wnd;
12781279
}
12791280
return;
12801281
}

0 commit comments

Comments
 (0)