Commit 67b12f79 authored by Matthieu Baerts's avatar Matthieu Baerts Committed by David S. Miller

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: 84dfe367 ("mptcp: send out dedicated ADD_ADDR packet")
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0eea5f1
...@@ -885,20 +885,16 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk, ...@@ -885,20 +885,16 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
return subflow->mp_capable; return subflow->mp_capable;
} }
if (mp_opt->dss && mp_opt->use_ack) { if ((mp_opt->dss && mp_opt->use_ack) ||
(mp_opt->add_addr && !mp_opt->echo)) {
/* subflows are fully established as soon as we get any /* subflows are fully established as soon as we get any
* additional ack. * additional ack, including ADD_ADDR.
*/ */
subflow->fully_established = 1; subflow->fully_established = 1;
WRITE_ONCE(msk->fully_established, true); WRITE_ONCE(msk->fully_established, true);
goto fully_established; goto fully_established;
} }
if (mp_opt->add_addr) {
WRITE_ONCE(msk->fully_established, true);
return true;
}
/* If the first established packet does not contain MP_CAPABLE + data /* If the first established packet does not contain MP_CAPABLE + data
* then fallback to TCP. Fallback scenarios requires a reset for * then fallback to TCP. Fallback scenarios requires a reset for
* MP_JOIN subflows. * MP_JOIN subflows.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment