From nobody Tue Feb 10 04:15:21 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:32da:0:0:0:0:0 with SMTP id f26csp607166uao; Sat, 17 Sep 2022 15:29:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49oa15lG+DSU3r6gSYFB8eUS6Bocik2MLqzT3GdQh7qETntptLalA/BcrUwOyQDexkttb1 X-Received: by 2002:a05:6214:769:b0:4ac:a40a:a5d7 with SMTP id f9-20020a056214076900b004aca40aa5d7mr9506631qvz.39.1663453781732; Sat, 17 Sep 2022 15:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663453781; cv=pass; d=google.com; s=arc-20160816; b=K2GrZ3UdEdHv1DUupYj5YVcGfya3aJecYUE6zML+dRS3f5ooCOv9G7IXvDLlo8twdl lF6h9Vl+Bj4depNq/hI8/wBV59LqaIT2EXfw9oKnlhoNmpIGlh16TeoIUITbght6VqDN bBBGPDrg7kbMayBc3Nwp7yKrpOADuc2DY2VS/a1y6WSTAeQ4qdccXjkk8IwWrUDUS/8N T8x/v8Kgf6bZujYCOETfyOSmWZSS8Mmrt+AnWXvqFJIGlduKfi2ZNdnhHLPAez5JobAx pPTRakM7HRlzimKONCsRHiijsg4quhrmrKAh/XJXym8ncR2To+C2bvSp1fk4Mr+5UF4o ayFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:message-id:cc:to:from:dkim-signature; bh=CjnHzb19W1HTiaiy3mDtVHHyf8GTgmbek5aJWS5nu7s=; b=SqS+ff1R1FMCsSOEO7nFTspzHuczb5X1yfs8dQ6SHSbrejQAa/xPtBIKRdmSfi9SGN Jm24NhSmURzbFBk3nP9XpwSVOdS0TULpd81YLHmhCmH7hZ+UMKQkNK19lBe91IRwvmbc Hht/HRgDJhCaOqmFVZreRQXFGi8oHdjx4+S7WlkfUx/4zN/tHs5xOhOTSO3oWAEuBMcp 2ZmEMMVMGcisq3tngrhZc8IC74XqdivTsFeRvQVuptMBts/XnN/P1p7BdulbLBJsR+2+ 2ckjAxhV7e2XLHzZxptlE0hD6pT3WMQi0SRxLAG8mCV/m1yTmfdSIkzijTLkURYK7I/Z r68Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@shytyi.net header.s=hs header.b=NGBBkFjG; arc=pass (i=1 spf=pass spfdomain=shytyi.net dkim=pass dkdomain=shytyi.net dmarc=pass fromdomain=shytyi.net>); spf=pass (google.com: domain of mptcp+bounces-6301-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="mptcp+bounces-6301-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l18-20020ae9f012000000b006bbe6e893cesi6341940qkg.143.2022.09.17.15.29.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Sep 2022 15:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-6301-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@shytyi.net header.s=hs header.b=NGBBkFjG; arc=pass (i=1 spf=pass spfdomain=shytyi.net dkim=pass dkdomain=shytyi.net dmarc=pass fromdomain=shytyi.net>); spf=pass (google.com: domain of mptcp+bounces-6301-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="mptcp+bounces-6301-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 71EFB1C209BB for ; Sat, 17 Sep 2022 22:29:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 775F75CA2; Sat, 17 Sep 2022 22:29:33 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from sender11-of-o51.zoho.eu (sender11-of-o51.zoho.eu [31.186.226.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B50805CB8 for ; Sat, 17 Sep 2022 22:29:30 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1663453761; cv=none; d=zohomail.eu; s=zohoarc; b=Kc+ddRLyJ6Vy7jPDpjCeSgcAxY4fmbtSGRyDimgVu3k7fiZ4wWK83Yy7mnhAgdCDoTf4of7JpwRxTTTbBwnvgRXot/NOUfjxcBAHJvsrI4c2u5K1oNGSGHgJ+WOxp/1rp5uN0ZbC5G3r0k508l5fCe7WeypuEpmQsBruatdeTC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1663453761; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=CjnHzb19W1HTiaiy3mDtVHHyf8GTgmbek5aJWS5nu7s=; b=lXprRpUO0j18v9qEuGMsGELwGUVx82gqTS5RyDBrVNuwggoMbVAzZHPCrruZ+z0gNVtR/6GnlbuTjdpIwk/9TloOg/t7MDcNEFdd3hPbI5GAmWZHkZOxKsJUGlZlHyR1pKZ0HBl7pFtR0Dm1OS1f6MUqkdndYvxLeWE0NdoEzmc= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=shytyi.net; spf=pass smtp.mailfrom=dmytro@shytyi.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663453761; s=hs; d=shytyi.net; i=dmytro@shytyi.net; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=CjnHzb19W1HTiaiy3mDtVHHyf8GTgmbek5aJWS5nu7s=; b=NGBBkFjG8oGUGzJrNTMvrU8Oehrqv4Ryke0AbutmD3ELhv3l+n9wu0R7VJW7SN0D Xlprrvqc15BP6S3gxtUE7EBlTpXIPqomHdY7uOCvu4g1Ds0mxNAR7lmMLDuiNWYoNLm fORILZbiVgdBBpiNgneF5RtA1/NY2n1iZoxNDpe8= Received: from doris.localdomain (243.34.22.93.rev.sfr.net [93.22.34.243]) by mx.zoho.eu with SMTPS id 166345375965291.97026866699537; Sun, 18 Sep 2022 00:29:19 +0200 (CEST) From: Dmytro Shytyi To: mptcp@lists.linux.dev Cc: Dmytro Shytyi Message-ID: <20220917222853.2406-11-dmytro@shytyi.net> Subject: [RFC PATCH mptcp-next v7 10/11] mptcp_fastopen_add_skb() helpers (skb to msk) Date: Sun, 18 Sep 2022 00:28:52 +0200 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220917222853.2406-1-dmytro@shytyi.net> References: <20220917222853.2406-1-dmytro@shytyi.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Set of helpers for mptcp_skb_add(). Some functions are inspired from tcp fastopen.c file. This chain helps to add =E2=80=9Cskb=E2=80=9D to=20 =E2=80=9C&msk->sk_receive_queue=E2=80=9D Example: =E2=80=9Csubflow_v4_conn_request=E2=80=9D->=E2=80=9Dmptcp_conn_req= uest=E2=80=9D-> =E2=80=9Dmptcp_try_fastopen=E2=80=9D->=E2=80=9Dmptcp_fastopen_create_child= =E2=80=9D-> =E2=80=9Dmptcp_fastopen_add_skb=E2=80=9D Signed-off-by: Dmytro Shytyi --- include/net/tcp.h | 27 +++++++ net/ipv4/tcp_fastopen.c | 38 +++++----- net/ipv4/tcp_input.c | 20 ++--- net/mptcp/fastopen.c | 163 ++++++++++++++++++++++++++++++++++++++++ net/mptcp/protocol.h | 39 ++++++++++ net/mptcp/subflow.c | 2 +- 6 files changed, 261 insertions(+), 28 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 735e957f7f4b..dc072d120f32 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1729,6 +1729,33 @@ int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, const struct tcp_md5sig_key *key); =20 /* From tcp_fastopen.c */ +struct sock *tcp_fastopen_create_child(struct sock *sk, + struct sk_buff *skb, + struct request_sock *req); +bool tcp_fastopen_queue_check(struct sock *sk); +int tcp_fastopen_get_cipher(struct net *net, struct inet_connection_sock *= icsk, + u64 *key); +void tcp_fastopen_cookie_gen(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *foc); +int tcp_fastopen_cookie_gen_check(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *orig, + struct tcp_fastopen_cookie *valid_foc); +bool tcp_fastopen_no_cookie(const struct sock *sk, + const struct dst_entry *dst, + int flag); +void tcp_reqsk_record_syn(const struct sock *sk, + struct request_sock *req, + const struct sk_buff *skb); +void tcp_ecn_create_request(struct request_sock *req, + const struct sk_buff *skb, + const struct sock *listen_sk, + const struct dst_entry *dst); +void tcp_openreq_init(struct request_sock *req, + const struct tcp_options_received *rx_opt, + struct sk_buff *skb, const struct sock *sk); void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, struct tcp_fastopen_cookie *cookie); void tcp_fastopen_cache_set(struct sock *sk, u16 mss, diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index 45cc7f1ca296..0963d7cbc8df 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c @@ -3,6 +3,7 @@ #include #include #include +#include "../mptcp/protocol.h" =20 void tcp_fastopen_init_key_once(struct net *net) { @@ -149,10 +150,10 @@ static bool __tcp_fastopen_cookie_gen_cipher(struct r= equest_sock *req, /* Generate the fastopen cookie by applying SipHash to both the source and * destination addresses. */ -static void tcp_fastopen_cookie_gen(struct sock *sk, - struct request_sock *req, - struct sk_buff *syn, - struct tcp_fastopen_cookie *foc) +void tcp_fastopen_cookie_gen(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *foc) { struct tcp_fastopen_context *ctx; =20 @@ -207,11 +208,11 @@ void tcp_fastopen_add_skb(struct sock *sk, struct sk_= buff *skb) } =20 /* returns 0 - no key match, 1 for primary, 2 for backup */ -static int tcp_fastopen_cookie_gen_check(struct sock *sk, - struct request_sock *req, - struct sk_buff *syn, - struct tcp_fastopen_cookie *orig, - struct tcp_fastopen_cookie *valid_foc) +int tcp_fastopen_cookie_gen_check(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *orig, + struct tcp_fastopen_cookie *valid_foc) { struct tcp_fastopen_cookie search_foc =3D { .len =3D -1 }; struct tcp_fastopen_cookie *foc =3D valid_foc; @@ -235,9 +236,9 @@ static int tcp_fastopen_cookie_gen_check(struct sock *s= k, return ret; } =20 -static struct sock *tcp_fastopen_create_child(struct sock *sk, - struct sk_buff *skb, - struct request_sock *req) +struct sock *tcp_fastopen_create_child(struct sock *sk, + struct sk_buff *skb, + struct request_sock *req) { struct tcp_sock *tp; struct request_sock_queue *queue =3D &inet_csk(sk)->icsk_accept_queue; @@ -283,7 +284,10 @@ static struct sock *tcp_fastopen_create_child(struct s= ock *sk, =20 tp->rcv_nxt =3D TCP_SKB_CB(skb)->seq + 1; =20 - tcp_fastopen_add_skb(child, skb); + if (sk_is_mptcp(sk)) + mptcp_fastopen_add_skb(child, skb, req); + else + tcp_fastopen_add_skb(child, skb); =20 tcp_rsk(req)->rcv_nxt =3D tp->rcv_nxt; tp->rcv_wup =3D tp->rcv_nxt; @@ -293,7 +297,7 @@ static struct sock *tcp_fastopen_create_child(struct so= ck *sk, return child; } =20 -static bool tcp_fastopen_queue_check(struct sock *sk) +bool tcp_fastopen_queue_check(struct sock *sk) { struct fastopen_queue *fastopenq; =20 @@ -329,9 +333,9 @@ static bool tcp_fastopen_queue_check(struct sock *sk) return true; } =20 -static bool tcp_fastopen_no_cookie(const struct sock *sk, - const struct dst_entry *dst, - int flag) +bool tcp_fastopen_no_cookie(const struct sock *sk, + const struct dst_entry *dst, + int flag) { return (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_fastopen) & flag) || tcp_sk(sk)->fastopen_no_cookie || diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index bc2ea12221f9..c82b3d0a801a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6730,10 +6730,10 @@ static inline void pr_drop_req(struct request_sock = *req, __u16 port, int family) * RFC8311 =C2=A74.3 which updates RFC3168 to allow the development of such * extensions. */ -static void tcp_ecn_create_request(struct request_sock *req, - const struct sk_buff *skb, - const struct sock *listen_sk, - const struct dst_entry *dst) +void tcp_ecn_create_request(struct request_sock *req, + const struct sk_buff *skb, + const struct sock *listen_sk, + const struct dst_entry *dst) { const struct tcphdr *th =3D tcp_hdr(skb); const struct net *net =3D sock_net(listen_sk); @@ -6754,9 +6754,9 @@ static void tcp_ecn_create_request(struct request_soc= k *req, inet_rsk(req)->ecn_ok =3D 1; } =20 -static void tcp_openreq_init(struct request_sock *req, - const struct tcp_options_received *rx_opt, - struct sk_buff *skb, const struct sock *sk) +void tcp_openreq_init(struct request_sock *req, + const struct tcp_options_received *rx_opt, + struct sk_buff *skb, const struct sock *sk) { struct inet_request_sock *ireq =3D inet_rsk(req); =20 @@ -6837,9 +6837,9 @@ static bool tcp_syn_flood_action(const struct sock *s= k, const char *proto) return want_cookie; } =20 -static void tcp_reqsk_record_syn(const struct sock *sk, - struct request_sock *req, - const struct sk_buff *skb) +void tcp_reqsk_record_syn(const struct sock *sk, + struct request_sock *req, + const struct sk_buff *skb) { if (tcp_sk(sk)->save_syn) { u32 len =3D skb_network_header_len(skb) + tcp_hdrlen(skb); diff --git a/net/mptcp/fastopen.c b/net/mptcp/fastopen.c index 1b9caf56e02f..b7c1c4523c10 100644 --- a/net/mptcp/fastopen.c +++ b/net/mptcp/fastopen.c @@ -166,3 +166,166 @@ void mptcp_fastopen_add_skb(struct sock *sk, struct s= k_buff *skb, struct request if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) tcp_fin(sk); } + +struct sock *mptcp_try_fastopen(struct sock *sk, struct sk_buff *skb, + struct request_sock *req, + struct tcp_fastopen_cookie *foc, + const struct dst_entry *dst) +{ + bool syn_data_status =3D TCP_SKB_CB(skb)->end_seq !=3D TCP_SKB_CB(skb)->s= eq + 1; + struct tcp_fastopen_cookie valid_mptcp_foc =3D { .len =3D -1 }; + struct sock *child_sock; + int ret =3D 0; + + if ((syn_data_status || foc->len >=3D 0) && + tcp_fastopen_queue_check(sk)) { + foc->len =3D -1; + return NULL; + } + + if (tcp_fastopen_no_cookie(sk, dst, TFO_SERVER_COOKIE_NOT_REQD)) + goto fastopen; + + if (foc->len =3D=3D 0) { + tcp_fastopen_cookie_gen(sk, req, skb, &valid_mptcp_foc); + } else if (foc->len > 0) { + ret =3D tcp_fastopen_cookie_gen_check(sk, req, skb, foc, + &valid_mptcp_foc); + if (ret) { +fastopen: + child_sock =3D tcp_fastopen_create_child(sk, skb, req); + if (child_sock) { + if (ret =3D=3D 2) { + valid_mptcp_foc.exp =3D foc->exp; + *foc =3D valid_mptcp_foc; + } else { + foc->len =3D -1; + } + return child_sock; + } + } + } + valid_mptcp_foc.exp =3D foc->exp; + *foc =3D valid_mptcp_foc; + return NULL; +} + +int mptcp_conn_request(struct request_sock_ops *rsk_ops, + const struct tcp_request_sock_ops *af_ops, + struct sock *sk, struct sk_buff *skb) +{ + struct tcp_fastopen_cookie mptcp_foc =3D { .len =3D -1 }; + struct tcp_options_received tmp_opt_rcvd; + __u32 isn =3D TCP_SKB_CB(skb)->tcp_tw_isn; + struct tcp_sock *tp_sock =3D tcp_sk(sk); + struct sock *mptcp_fo_sk =3D NULL; + struct net *net =3D sock_net(sk); + struct request_sock *req_sock; + bool want_cookie =3D false; + struct dst_entry *dst; + struct flowi fl; + + if (sk_acceptq_is_full(sk)) + goto drop; + + req_sock =3D inet_reqsk_alloc(rsk_ops, sk, !want_cookie); + if (!req_sock) + goto drop; + + req_sock->syncookie =3D want_cookie; + tcp_rsk(req_sock)->af_specific =3D af_ops; + tcp_rsk(req_sock)->ts_off =3D 1; + tcp_rsk(req_sock)->is_mptcp =3D 1; + + tcp_clear_options(&tmp_opt_rcvd); + tmp_opt_rcvd.mss_clamp =3D af_ops->mss_clamp; + tmp_opt_rcvd.user_mss =3D tp_sock->rx_opt.user_mss; + tcp_parse_options(sock_net(sk), skb, &tmp_opt_rcvd, 0, + want_cookie ? NULL : &mptcp_foc); + + if (want_cookie && !tmp_opt_rcvd.saw_tstamp) + tcp_clear_options(&tmp_opt_rcvd); + + if (IS_ENABLED(CONFIG_SMC) && want_cookie) + tmp_opt_rcvd.smc_ok =3D 0; + + tmp_opt_rcvd.tstamp_ok =3D 0; + tcp_openreq_init(req_sock, &tmp_opt_rcvd, skb, sk); + inet_rsk(req_sock)->no_srccheck =3D inet_sk(sk)->transparent; + + inet_rsk(req_sock)->ir_iif =3D inet_request_bound_dev_if(sk, skb); + + dst =3D af_ops->route_req(sk, skb, &fl, req_sock); + if (!dst) + goto drop_and_free; + + if (tmp_opt_rcvd.tstamp_ok) + tcp_rsk(req_sock)->ts_off =3D af_ops->init_ts_off(net, skb); + + if (!want_cookie && !isn) { + if (!net->ipv4.sysctl_tcp_syncookies && + (net->ipv4.sysctl_max_syn_backlog - inet_csk_reqsk_queue_len(sk) < + (net->ipv4.sysctl_max_syn_backlog >> 2)) && + !tcp_peer_is_proven(req_sock, dst)) { + goto drop_and_release; + } + + isn =3D af_ops->init_seq(skb); + } + + tcp_ecn_create_request(req_sock, skb, sk, dst); + + if (want_cookie) { + isn =3D cookie_init_sequence(af_ops, sk, skb, &req_sock->mss); + if (!tmp_opt_rcvd.tstamp_ok) + inet_rsk(req_sock)->ecn_ok =3D 0; + } + + tcp_rsk(req_sock)->snt_isn =3D isn; + tcp_rsk(req_sock)->txhash =3D net_tx_rndhash(); + tcp_rsk(req_sock)->syn_tos =3D TCP_SKB_CB(skb)->ip_dsfield; + + tcp_openreq_init_rwin(req_sock, sk, dst); + sk_rx_queue_set(req_to_sk(req_sock), skb); + if (!want_cookie) { + tcp_reqsk_record_syn(sk, req_sock, skb); + mptcp_fo_sk =3D mptcp_try_fastopen(sk, skb, req_sock, &mptcp_foc, dst); + } + if (mptcp_fo_sk) { + af_ops->send_synack(mptcp_fo_sk, dst, &fl, req_sock, + &mptcp_foc, TCP_SYNACK_FASTOPEN, skb); + if (!inet_csk_reqsk_queue_add(sk, req_sock, mptcp_fo_sk)) { + reqsk_fastopen_remove(mptcp_fo_sk, req_sock, false); + bh_unlock_sock(mptcp_fo_sk); + sock_put(mptcp_fo_sk); + goto drop_and_free; + } + sk->sk_data_ready(sk); + bh_unlock_sock(mptcp_fo_sk); + sock_put(mptcp_fo_sk); + } else { + tcp_rsk(req_sock)->tfo_listener =3D false; + if (!want_cookie) { + req_sock->timeout =3D tcp_timeout_init((struct sock *)req_sock); + inet_csk_reqsk_queue_hash_add(sk, req_sock, req_sock->timeout); + } + af_ops->send_synack(sk, dst, &fl, req_sock, &mptcp_foc, + !want_cookie ? TCP_SYNACK_NORMAL : + TCP_SYNACK_COOKIE, + skb); + if (want_cookie) { + reqsk_free(req_sock); + return 0; + } + } + reqsk_put(req_sock); + return 0; + +drop_and_release: + dst_release(dst); +drop_and_free: + __reqsk_free(req_sock); +drop: + tcp_listendrop(sk); + return 0; +} diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b90279c734ae..8d894a2d06b3 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -849,6 +849,45 @@ int mptcp_setsockopt_sol_tcp_fastopen(struct mptcp_soc= k *msk, sockptr_t optval, unsigned int optlen); void mptcp_treat_hshake_ack_fastopen(struct mptcp_sock *msk, struct mptcp_= subflow_context *subflow, struct mptcp_options_received mp_opt); +void mptcp_fastopen_add_skb(struct sock *sk, struct sk_buff *skb, + struct request_sock *req); +void mptcp_reqsk_record_syn(const struct sock *sk, + struct request_sock *req, + const struct sk_buff *skb); +void mptcp_ecn_create_request(struct request_sock *req, + const struct sk_buff *skb, + const struct sock *listen_sk, + const struct dst_entry *dst); +void mptcp_openreq_init(struct request_sock *req, + const struct tcp_options_received *rx_opt, + struct sk_buff *skb, const struct sock *sk); +struct sock *mptcp_fastopen_create_child(struct sock *sk, + struct sk_buff *skb, + struct request_sock *req); +bool mptcp_fastopen_queue_check(struct sock *sk); +bool mptcp_fastopen_cookie_gen_cipher(struct request_sock *req, + struct sk_buff *syn, + const siphash_key_t *key, + struct tcp_fastopen_cookie *foc); +void mptcp_fastopen_cookie_gen(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *foc); +int mptcp_fastopen_cookie_gen_check(struct sock *sk, + struct request_sock *req, + struct sk_buff *syn, + struct tcp_fastopen_cookie *orig, + struct tcp_fastopen_cookie *valid_foc); +bool mptcp_fastopen_no_cookie(const struct sock *sk, + const struct dst_entry *dst, + int flag); +struct sock *mptcp_try_fastopen(struct sock *sk, struct sk_buff *skb, + struct request_sock *req, + struct tcp_fastopen_cookie *foc, + const struct dst_entry *dst); +int mptcp_conn_request(struct request_sock_ops *rsk_ops, + const struct tcp_request_sock_ops *af_ops, + struct sock *sk, struct sk_buff *skb); // Fast Open Mechanism functions end =20 static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 075c61d1d37f..ff5fe4ff3d21 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -542,7 +542,7 @@ static int subflow_v4_conn_request(struct sock *sk, str= uct sk_buff *skb) if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) goto drop; =20 - return tcp_conn_request(&mptcp_subflow_request_sock_ops, + return mptcp_conn_request(&mptcp_subflow_request_sock_ops, &subflow_request_sock_ipv4_ops, sk, skb); drop: --=20 2.25.1