All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const
@ 2022-02-10 14:55 Florian Westphal
  2022-02-10 20:42 ` Mat Martineau
  2022-02-11 11:03 ` Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Westphal @ 2022-02-10 14:55 UTC (permalink / raw)
  To: mptcp; +Cc: Florian Westphal

Thre returned structure is read-only.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 Could be squashed with 'mptcp: mark ops structures as ro_after_init'.

 net/mptcp/subflow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 5bd49a350750..e727d838da0e 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -787,7 +787,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 	return child;
 }
 
-static struct inet_connection_sock_af_ops subflow_specific;
+static struct inet_connection_sock_af_ops subflow_specific __ro_after_init;
 static struct proto tcp_prot_override;
 
 enum mapping_status {
@@ -1313,7 +1313,7 @@ static void subflow_write_space(struct sock *ssk)
 	mptcp_write_space(sk);
 }
 
-static struct inet_connection_sock_af_ops *
+static const struct inet_connection_sock_af_ops *
 subflow_default_af_ops(struct sock *sk)
 {
 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
@@ -1328,7 +1328,7 @@ void mptcpv6_handle_mapped(struct sock *sk, bool mapped)
 {
 	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
 	struct inet_connection_sock *icsk = inet_csk(sk);
-	struct inet_connection_sock_af_ops *target;
+	const struct inet_connection_sock_af_ops *target;
 
 	target = mapped ? &subflow_v6m_specific : subflow_default_af_ops(sk);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const
  2022-02-10 14:55 [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const Florian Westphal
@ 2022-02-10 20:42 ` Mat Martineau
  2022-02-11 11:03 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Mat Martineau @ 2022-02-10 20:42 UTC (permalink / raw)
  To: Florian Westphal; +Cc: mptcp

On Thu, 10 Feb 2022, Florian Westphal wrote:

> Thre returned structure is read-only.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> Could be squashed with 'mptcp: mark ops structures as ro_after_init'.
>

Yeah, I agree that it would be good to squash with the other 
ro_after_init changes. Patch looks fine.

-Mat

> net/mptcp/subflow.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index 5bd49a350750..e727d838da0e 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -787,7 +787,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
> 	return child;
> }
>
> -static struct inet_connection_sock_af_ops subflow_specific;
> +static struct inet_connection_sock_af_ops subflow_specific __ro_after_init;
> static struct proto tcp_prot_override;
>
> enum mapping_status {
> @@ -1313,7 +1313,7 @@ static void subflow_write_space(struct sock *ssk)
> 	mptcp_write_space(sk);
> }
>
> -static struct inet_connection_sock_af_ops *
> +static const struct inet_connection_sock_af_ops *
> subflow_default_af_ops(struct sock *sk)
> {
> #if IS_ENABLED(CONFIG_MPTCP_IPV6)
> @@ -1328,7 +1328,7 @@ void mptcpv6_handle_mapped(struct sock *sk, bool mapped)
> {
> 	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
> 	struct inet_connection_sock *icsk = inet_csk(sk);
> -	struct inet_connection_sock_af_ops *target;
> +	const struct inet_connection_sock_af_ops *target;
>
> 	target = mapped ? &subflow_v6m_specific : subflow_default_af_ops(sk);
>
> -- 
> 2.34.1
>
>
>

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const
  2022-02-10 14:55 [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const Florian Westphal
  2022-02-10 20:42 ` Mat Martineau
@ 2022-02-11 11:03 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2022-02-11 11:03 UTC (permalink / raw)
  To: Florian Westphal, Mat Martineau; +Cc: mptcp

Hi Florian, Mat,

On 10/02/2022 15:55, Florian Westphal wrote:
> Thre returned structure is read-only.

Thank you for this patch and the review!

Now in our tree (squashed):

- a2b3e7491b59: "squashed" in "mptcp: mark ops structures as ro_after_init"
- Results: 7f0a980be1a6..178780fe8241

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220211T110237
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-11 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 14:55 [PATCH mptcp-next] mptcp: subflow: get_af_ops should return const Florian Westphal
2022-02-10 20:42 ` Mat Martineau
2022-02-11 11:03 ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.