Skip to content

Commit 67b12f7

Browse files
matttbedavem330
authored andcommitted
mptcp: full fully established support after ADD_ADDR
If directly after an MP_CAPABLE 3WHS, the client receives an ADD_ADDR with HMAC from the server, it is enough to switch to a "fully established" mode because it has received more MPTCP options. It was then OK to enable the "fully_established" flag on the MPTCP socket. Still, best to check if the ADD_ADDR looks valid by looking if it contains an HMAC (no 'echo' bit). If an ADD_ADDR echo is received while we are not in "fully established" mode, it is strange and then we should not switch to this mode now. But that is not enough. On one hand, the path-manager has be notified the state has changed. On the other hand, the "fully_established" flag on the subflow socket should be turned on as well not to re-send the MP_CAPABLE 3rd ACK content with the next ACK. Fixes: 84dfe36 ("mptcp: send out dedicated ADD_ADDR packet") Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a0eea5f commit 67b12f7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

net/mptcp/options.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -885,20 +885,16 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
885885
return subflow->mp_capable;
886886
}
887887

888-
if (mp_opt->dss && mp_opt->use_ack) {
888+
if ((mp_opt->dss && mp_opt->use_ack) ||
889+
(mp_opt->add_addr && !mp_opt->echo)) {
889890
/* subflows are fully established as soon as we get any
890-
* additional ack.
891+
* additional ack, including ADD_ADDR.
891892
*/
892893
subflow->fully_established = 1;
893894
WRITE_ONCE(msk->fully_established, true);
894895
goto fully_established;
895896
}
896897

897-
if (mp_opt->add_addr) {
898-
WRITE_ONCE(msk->fully_established, true);
899-
return true;
900-
}
901-
902898
/* If the first established packet does not contain MP_CAPABLE + data
903899
* then fallback to TCP. Fallback scenarios requires a reset for
904900
* MP_JOIN subflows.

0 commit comments

Comments
 (0)