Skip to contentSkip to conversation

Move subflow ipv6 code earlier in subflow.c

PATCH In review Mat Martineau 3 participants 3 messages Jan 18, 2020 – Jan 20, 2020

Subsystems (2)
lore
Share & tools
lore

Mat Martineau

author
#0 lore raw

PATCH 1/1 Move subflow ipv6 code earlier in subflow.c

This prevents some diff noise in "mptcp: Implement MPTCP receive path", where the code is currently moved.

squashto: "mptcp: Handle MP_CAPABLE options for outgoing connections"

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
 net/mptcp/subflow.c | 52 ++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 26 deletions(-)
net/mptcp/subflow.c +26 -26
index 1eff992a43dc..c3ce0fe369b7 100644
@@ -106,6 +106,32 @@ static int subflow_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops;
+static struct inet_connection_sock_af_ops subflow_v6_specific;
+static struct inet_connection_sock_af_ops subflow_v6m_specific;
+
+static int subflow_v6_conn_request(struct sock *sk, struct sk_buff *skb)
+{
+	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
+
+	pr_debug("subflow=%p", subflow);
+
+	if (skb->protocol == htons(ETH_P_IP))
+		return subflow_v4_conn_request(sk, skb);
+
+	if (!ipv6_unicast_destination(skb))
+		goto drop;
+
+	return tcp_conn_request(&subflow_request_sock_ops,
+				&subflow_request_sock_ipv6_ops, sk, skb);
+
+drop:
+	tcp_listendrop(sk);
+	return 0; /* don't send reset */
+}
+#endif
+
 static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 					  struct sk_buff *skb,
 					  struct request_sock *req,
@@ -138,32 +164,6 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 
 static struct inet_connection_sock_af_ops subflow_specific;
 
-#if IS_ENABLED(CONFIG_MPTCP_IPV6)
-static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops;
-static struct inet_connection_sock_af_ops subflow_v6_specific;
-static struct inet_connection_sock_af_ops subflow_v6m_specific;
-
-static int subflow_v6_conn_request(struct sock *sk, struct sk_buff *skb)
-{
-	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
-
-	pr_debug("subflow=%p", subflow);
-
-	if (skb->protocol == htons(ETH_P_IP))
-		return subflow_v4_conn_request(sk, skb);
-
-	if (!ipv6_unicast_destination(skb))
-		goto drop;
-
-	return tcp_conn_request(&subflow_request_sock_ops,
-				&subflow_request_sock_ipv6_ops, sk, skb);
-
-drop:
-	tcp_listendrop(sk);
-	return 0; /* don't send reset */
-}
-#endif
-
 static struct inet_connection_sock_af_ops *
 subflow_default_af_ops(struct sock *sk)
 {
Signature · 1 line
2.25.0
#1 lore raw
Quoted 6 lines · Mat Martineau

This prevents some diff noise in "mptcp: Implement MPTCP receive path", where the code is currently moved.

squashto: "mptcp: Handle MP_CAPABLE options for outgoing connections"

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>

LGTM! yep, noise in later patch make the latter much less unreadable.

Thanks for addressing that!

Paolo

#2 lore raw

Hi Mat, Paolo,

Quoted 11 lines · Paolo Abeni
Quoted 6 lines · Mat Martineau

This prevents some diff noise in "mptcp: Implement MPTCP receive path", where the code is currently moved.

squashto: "mptcp: Handle MP_CAPABLE options for outgoing connections"

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>

LGTM! yep, noise in later patch make the latter much less unreadable.

Thanks for addressing that!

Thank you for the patch and the review!

- 3d4edf2302a5: "squashed" in "mptcp: Handle MP_CAPABLE options for outgoing connections"
- b6685f0043f6: conflict in t/mptcp-Implement-MPTCP-receive-path
- d23bb6b15878..485d1d576dcd: result (empty, as expected, no?)

But now, t/mptcp-Implement-MPTCP-receive-path is indeed cleaner

Tests + export will be launched soon.

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium