diff options
author | Paolo Abeni <pabeni@redhat.com> | 2022-11-25 23:29:49 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-30 05:24:25 +0100 |
commit | b3ea6b272d79a43baaaa9af871ee66f6fda4688f (patch) | |
tree | 8bf89e6610ebfbe5289d83a3f7a90082e6eb29cf /net/mptcp/options.c | |
parent | mptcp: track accurately the incoming MPC suboption type (diff) | |
download | linux-b3ea6b272d79a43baaaa9af871ee66f6fda4688f.tar.xz linux-b3ea6b272d79a43baaaa9af871ee66f6fda4688f.zip |
mptcp: consolidate initial ack seq generation
Currently the initial ack sequence is generated on demand whenever
it's requested and the remote key is handy. The relevant code is
scattered in different places and can lead to multiple, unneeded,
crypto operations.
This change consolidates the ack sequence generation code in a single
helper, storing the sequence number at the subflow level.
The above additionally saves a few conditional in fast-path and will
simplify the upcoming fast-open implementation.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp/options.c')
-rw-r--r-- | net/mptcp/options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 784a205e80da..ae076468fcb9 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -953,8 +953,9 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk, return subflow->mp_capable; } - if (((mp_opt->suboptions & OPTION_MPTCP_DSS) && mp_opt->use_ack) || - ((mp_opt->suboptions & OPTION_MPTCP_ADD_ADDR) && !mp_opt->echo)) { + if (subflow->remote_key_valid && + (((mp_opt->suboptions & OPTION_MPTCP_DSS) && mp_opt->use_ack) || + ((mp_opt->suboptions & OPTION_MPTCP_ADD_ADDR) && !mp_opt->echo))) { /* subflows are fully established as soon as we get any * additional ack, including ADD_ADDR. */ |