netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netdev@vger.kernel.org>
Cc: edumazet@google.com, mathew.j.martineau@linux.intel.com,
	matthieu.baerts@tessares.net, pabeni@redhat.com,
	Florian Westphal <fw@strlen.de>
Subject: [PATCH v2 net-next 4/9] mptcp: rename and export mptcp_subflow_request_sock_ops
Date: Thu, 30 Jul 2020 21:25:53 +0200	[thread overview]
Message-ID: <20200730192558.25697-5-fw@strlen.de> (raw)
In-Reply-To: <20200730192558.25697-1-fw@strlen.de>

syncookie code path needs to create an mptcp request sock.

Prepare for this and add mptcp prefix plus needed export of ops struct.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 include/net/mptcp.h |  1 +
 net/mptcp/subflow.c | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index 02158c257bd4..76eb915bf91c 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -58,6 +58,7 @@ struct mptcp_out_options {
 };
 
 #ifdef CONFIG_MPTCP
+extern struct request_sock_ops mptcp_subflow_request_sock_ops;
 
 void mptcp_init(void);
 
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 091e305a81c8..9b11d2b6ff4d 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -284,7 +284,8 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 	tcp_done(sk);
 }
 
-static struct request_sock_ops subflow_request_sock_ops;
+struct request_sock_ops mptcp_subflow_request_sock_ops;
+EXPORT_SYMBOL_GPL(mptcp_subflow_request_sock_ops);
 static struct tcp_request_sock_ops subflow_request_sock_ipv4_ops;
 
 static int subflow_v4_conn_request(struct sock *sk, struct sk_buff *skb)
@@ -297,7 +298,7 @@ static int subflow_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 	if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
 		goto drop;
 
-	return tcp_conn_request(&subflow_request_sock_ops,
+	return tcp_conn_request(&mptcp_subflow_request_sock_ops,
 				&subflow_request_sock_ipv4_ops,
 				sk, skb);
 drop:
@@ -322,7 +323,7 @@ static int subflow_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 	if (!ipv6_unicast_destination(skb))
 		goto drop;
 
-	return tcp_conn_request(&subflow_request_sock_ops,
+	return tcp_conn_request(&mptcp_subflow_request_sock_ops,
 				&subflow_request_sock_ipv6_ops, sk, skb);
 
 drop:
@@ -1311,8 +1312,8 @@ static int subflow_ops_init(struct request_sock_ops *subflow_ops)
 
 void __init mptcp_subflow_init(void)
 {
-	subflow_request_sock_ops = tcp_request_sock_ops;
-	if (subflow_ops_init(&subflow_request_sock_ops) != 0)
+	mptcp_subflow_request_sock_ops = tcp_request_sock_ops;
+	if (subflow_ops_init(&mptcp_subflow_request_sock_ops) != 0)
 		panic("MPTCP: failed to init subflow request sock ops\n");
 
 	subflow_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops;
-- 
2.26.2


  parent reply	other threads:[~2020-07-30 19:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 19:25 [PATCH v2 net-next 0/9] mptcp: add syncookie support Florian Westphal
2020-07-30 19:25 ` [PATCH v2 net-next 1/9] tcp: rename request_sock cookie_ts bit to syncookie Florian Westphal
2020-07-30 19:25 ` [PATCH v2 net-next 2/9] mptcp: token: move retry to caller Florian Westphal
2020-07-31 22:37   ` Mat Martineau
2020-07-30 19:25 ` [PATCH v2 net-next 3/9] mptcp: subflow: split subflow_init_req Florian Westphal
2020-07-31 22:37   ` Mat Martineau
2020-07-30 19:25 ` Florian Westphal [this message]
2020-07-31 22:38   ` [PATCH v2 net-next 4/9] mptcp: rename and export mptcp_subflow_request_sock_ops Mat Martineau
2020-07-30 19:25 ` [PATCH v2 net-next 5/9] mptcp: subflow: add mptcp_subflow_init_cookie_req helper Florian Westphal
2020-07-31 22:38   ` Mat Martineau
2020-07-30 19:25 ` [PATCH v2 net-next 6/9] tcp: syncookies: create mptcp request socket for ACK cookies with MPTCP option Florian Westphal
2020-07-30 19:25 ` [PATCH v2 net-next 7/9] mptcp: enable JOIN requests even if cookies are in use Florian Westphal
2020-07-31 22:39   ` Mat Martineau
2020-08-01  1:50   ` Eric Dumazet
2020-07-30 19:25 ` [PATCH v2 net-next 8/9] selftests: mptcp: make 2nd net namespace use tcp syn cookies unconditionally Florian Westphal
2020-07-31 22:39   ` Mat Martineau
2020-07-30 19:25 ` [PATCH v2 net-next 9/9] selftests: mptcp: add test cases for mptcp join tests with syn cookies Florian Westphal
2020-07-31 22:39   ` Mat Martineau
2020-07-31 23:56 ` [PATCH v2 net-next 0/9] mptcp: add syncookie support David Miller
2020-08-01  1:55   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200730192558.25697-5-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=edumazet@google.com \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).