diff mbox series

[v2,5/6] mptcp: Export low-level routines for IPv6

Message ID 20191106044133.14418-6-peter.krystad@linux.intel.com
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series IPv6 support | expand

Commit Message

Peter Krystad Nov. 6, 2019, 4:41 a.m. UTC
ipv6_specific and tcp_request_sock_ipv6_ops will be referenced
during TCP subflow creation.

squashto: tcp: Export TCP functions and ops

Signed-off-by: Peter Krystad <peter.krystad@linux.intel.com>
---
 include/net/tcp.h    | 3 +++
 net/ipv6/tcp_ipv6.c  | 9 +++++----
 net/mptcp/protocol.h | 3 +++
 3 files changed, 11 insertions(+), 4 deletions(-)

Comments

Paolo Abeni Nov. 6, 2019, 9:03 a.m. UTC | #1
On Tue, 2019-11-05 at 20:41 -0800, Peter Krystad wrote:
> @@ -1111,7 +1111,8 @@ static void tcp_v6_restore_cb(struct sk_buff *skb)
>  		sizeof(struct inet6_skb_parm));
>  }
>  
> -static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
> +static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk,
> +					 struct sk_buff *skb,
>  					 struct request_sock *req,
>  					 struct dst_entry *dst,
>  					 struct request_sock *req_unhash,

Minor nit: it looks like this chunk is not needed[1].

Cheers,

Paolo

[1] https://youtu.be/XfEuxRDYiyc ;)
Matthieu Baerts Nov. 6, 2019, 9:37 a.m. UTC | #2
Hi Paolo,

On 06/11/2019 10:03, Paolo Abeni wrote:
> On Tue, 2019-11-05 at 20:41 -0800, Peter Krystad wrote:
>> @@ -1111,7 +1111,8 @@ static void tcp_v6_restore_cb(struct sk_buff *skb)
>>   		sizeof(struct inet6_skb_parm));
>>   }
>>   
>> -static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
>> +static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk,
>> +					 struct sk_buff *skb,
>>   					 struct request_sock *req,
>>   					 struct dst_entry *dst,
>>   					 struct request_sock *req_unhash,
> 
> Minor nit: it looks like this chunk is not needed[1].

Peter replied this in the previous version of the patch:

 > It seemed like since I was in the neighborhood I would fix this
 > over-80 char line. If that's not appropriate we can drop this chunk.

I guess we should not modify the style of non MPTCP code. Then better to 
drop this change, right?

Cheers,
Matt
Paolo Abeni Nov. 6, 2019, 10:09 a.m. UTC | #3
On Wed, 2019-11-06 at 10:37 +0100, Matthieu Baerts wrote:
> Hi Paolo,
> 
> On 06/11/2019 10:03, Paolo Abeni wrote:
> > On Tue, 2019-11-05 at 20:41 -0800, Peter Krystad wrote:
> > > @@ -1111,7 +1111,8 @@ static void tcp_v6_restore_cb(struct sk_buff *skb)
> > >   		sizeof(struct inet6_skb_parm));
> > >   }
> > >   
> > > -static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
> > > +static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk,
> > > +					 struct sk_buff *skb,
> > >   					 struct request_sock *req,
> > >   					 struct dst_entry *dst,
> > >   					 struct request_sock *req_unhash,
> > 
> > Minor nit: it looks like this chunk is not needed[1].
> 
> Peter replied this in the previous version of the patch:
> 
>  > It seemed like since I was in the neighborhood I would fix this
>  > over-80 char line. If that's not appropriate we can drop this chunk.

whoops, I missed that, sorry! And thank you for the head-up!

> I guess we should not modify the style of non MPTCP code. Then better to 
> drop this change, right?

Yes, exactly. The above change should be in a separate, non mptcp-
related patch.

Cheers,

Paolo
Matthieu Baerts Nov. 6, 2019, 3:18 p.m. UTC | #4
Hi Peter,

On 06/11/2019 16:16, Peter Krystad wrote:
> 
> Matthieu -
> 
> On Wed, 2019-11-06 at 11:09 +0100, Paolo Abeni wrote:
>> On Wed, 2019-11-06 at 10:37 +0100, Matthieu Baerts wrote:
>>> Hi Paolo,
>>>
>>> On 06/11/2019 10:03, Paolo Abeni wrote:
>>>> On Tue, 2019-11-05 at 20:41 -0800, Peter Krystad wrote:
>>>>> @@ -1111,7 +1111,8 @@ static void tcp_v6_restore_cb(struct sk_buff *skb)
>>>>>    		sizeof(struct inet6_skb_parm));
>>>>>    }
>>>>>    
>>>>> -static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
>>>>> +static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk,
>>>>> +					 struct sk_buff *skb,
>>>>>    					 struct request_sock *req,
>>>>>    					 struct dst_entry *dst,
>>>>>    					 struct request_sock *req_unhash,
>>>>
>>>> Minor nit: it looks like this chunk is not needed[1].
>>>
>>> Peter replied this in the previous version of the patch:
>>>
>>>   > It seemed like since I was in the neighborhood I would fix this
>>>   > over-80 char line. If that's not appropriate we can drop this chunk.
>>
>> whoops, I missed that, sorry! And thank you for the head-up!
>>
>>> I guess we should not modify the style of non MPTCP code. Then better to
>>> drop this change, right?
>>
>> Yes, exactly. The above change should be in a separate, non mptcp-
>> related patch.
> 
> Can you just drop this when you squash it?

Sure, I can do that!

Cheers,
Matt
diff mbox series

Patch

diff --git a/include/net/tcp.h b/include/net/tcp.h
index f1a0bdb7d1b1..74840bb2a4f3 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1990,6 +1990,9 @@  struct tcp_request_sock_ops {
 };
 
 extern const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops;
+#if IS_ENABLED(CONFIG_IPV6)
+extern const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops;
+#endif
 
 #ifdef CONFIG_SYN_COOKIES
 static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 4804b6dc5e65..50f6f21bbdb1 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -75,7 +75,7 @@  static void	tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb,
 static int	tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
 
 static const struct inet_connection_sock_af_ops ipv6_mapped;
-static const struct inet_connection_sock_af_ops ipv6_specific;
+const struct inet_connection_sock_af_ops ipv6_specific;
 #ifdef CONFIG_TCP_MD5SIG
 static const struct tcp_sock_af_ops tcp_sock_ipv6_specific;
 static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific;
@@ -785,7 +785,7 @@  struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
 	.syn_ack_timeout =	tcp_syn_ack_timeout,
 };
 
-static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
+const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
 	.mss_clamp	=	IPV6_MIN_MTU - sizeof(struct tcphdr) -
 				sizeof(struct ipv6hdr),
 #ifdef CONFIG_TCP_MD5SIG
@@ -1111,7 +1111,8 @@  static void tcp_v6_restore_cb(struct sk_buff *skb)
 		sizeof(struct inet6_skb_parm));
 }
 
-static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
+static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk,
+					 struct sk_buff *skb,
 					 struct request_sock *req,
 					 struct dst_entry *dst,
 					 struct request_sock *req_unhash,
@@ -1739,7 +1740,7 @@  static struct timewait_sock_ops tcp6_timewait_sock_ops = {
 	.twsk_destructor = tcp_twsk_destructor,
 };
 
-static const struct inet_connection_sock_af_ops ipv6_specific = {
+const struct inet_connection_sock_af_ops ipv6_specific = {
 	.queue_xmit	   = inet6_csk_xmit,
 	.send_check	   = tcp_v6_send_check,
 	.rebuild_header	   = inet6_sk_rebuild_header,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 7f783ca65f43..c6102ca3c79e 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -269,6 +269,9 @@  int mptcp_subflow_connect(struct sock *sk, struct sockaddr *local,
 int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock);
 
 extern const struct inet_connection_sock_af_ops ipv4_specific;
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+extern const struct inet_connection_sock_af_ops ipv6_specific;
+#endif
 
 void mptcp_proto_init(void);