aboutsummaryrefslogtreecommitdiff
path: root/net/mptcp/ctrl.c
diff options
context:
space:
mode:
authorGravatar Florian Westphal <fw@strlen.de> 2020-07-30 21:25:56 +0200
committerGravatar David S. Miller <davem@davemloft.net> 2020-07-31 16:55:32 -0700
commit9466a1ccebbe54ac57fb8a89c2b4b854826546a8 (patch)
treeb63b7b800c1f51d16b26cf41029f27f4e478270f /net/mptcp/ctrl.c
parenttcp: syncookies: create mptcp request socket for ACK cookies with MPTCP option (diff)
downloadlinux-9466a1ccebbe54ac57fb8a89c2b4b854826546a8.tar.gz
linux-9466a1ccebbe54ac57fb8a89c2b4b854826546a8.tar.bz2
linux-9466a1ccebbe54ac57fb8a89c2b4b854826546a8.zip
mptcp: enable JOIN requests even if cookies are in use
JOIN requests do not work in syncookie mode -- for HMAC validation, the peers nonce and the mptcp token (to obtain the desired connection socket the join is for) are required, but this information is only present in the initial syn. So either we need to drop all JOIN requests once a listening socket enters syncookie mode, or we need to store enough state to reconstruct the request socket later. This adds a state table (1024 entries) to store the data present in the MP_JOIN syn request and the random nonce used for the cookie syn/ack. When a MP_JOIN ACK passed cookie validation, the table is consulted to rebuild the request socket from it. An alternate approach would be to "cancel" syn-cookie mode and force MP_JOIN to always use a syn queue entry. However, doing so brings the backlog over the configured queue limit. v2: use req->syncookie, not (removed) want_cookie arg Suggested-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/ctrl.c')
-rw-r--r--net/mptcp/ctrl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c
index 8e39585d37f3..54b888f94009 100644
--- a/net/mptcp/ctrl.c
+++ b/net/mptcp/ctrl.c
@@ -112,6 +112,7 @@ static struct pernet_operations mptcp_pernet_ops = {
void __init mptcp_init(void)
{
+ mptcp_join_cookie_init();
mptcp_proto_init();
if (register_pernet_subsys(&mptcp_pernet_ops) < 0)