From: Matthieu Baerts <matttbe@kernel.org>
To: David Carlier <devnexen@gmail.com>, mptcp@lists.linux.dev
Cc: Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH mptcp-next v4 2/4] mptcp: propagate RECVERR sockopts to subflows
Date: Fri, 1 May 2026 17:56:16 +0200 [thread overview]
Message-ID: <b9eb46be-0916-4932-b9d2-165eea2aeb6b@kernel.org> (raw)
In-Reply-To: <21762831cbe0d70fd963dd7f0ed9e05b050a7d1f.1777324037.git.devnexen@gmail.com>
On 27/04/2026 23:10, David Carlier wrote:
> Propagate IP_RECVERR/IP_RECVERR_RFC4884 and
> IPV6_RECVERR/IPV6_RECVERR_RFC4884 from the MPTCP socket to existing
> and future subflows. The setsockopt path forwards each option to
> every subflow via mptcp_setsockopt_all_sf(); newly-joining subflows
> inherit the four RECVERR bits through sync_socket_options() now that
> MPTCP_INET_FLAGS_MASK covers them.
>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Assisted-by: Codex:gpt-5
> Signed-off-by: David Carlier <devnexen@gmail.com>
> ---
> net/mptcp/sockopt.c | 97 ++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 79 insertions(+), 18 deletions(-)
>
> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 41c9dc9cf95e..171e83e66a97 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
(...)
> @@ -388,6 +394,41 @@ static int mptcp_setsockopt_sol_socket(struct mptcp_sock *msk, int optname,
> return -EOPNOTSUPP;
> }
>
> +static int mptcp_setsockopt_all_sf(struct mptcp_sock *msk, int level,
> + int optname, sockptr_t optval,
> + unsigned int optlen)
> +{
> + struct mptcp_subflow_context *subflow;
> + int ret = 0;
> +
> + mptcp_for_each_subflow(msk, subflow) {
> + struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
> +
> + ret = tcp_setsockopt(ssk, level, optname, optval, optlen);
> + if (ret)
> + break;
> + }
> + return ret;
> +}
> +
> +#if IS_ENABLED(CONFIG_IPV6)
> +static int mptcp_setsockopt_v6_recverr(struct mptcp_sock *msk, int optname,
> + sockptr_t optval, unsigned int optlen)
> +{
> + struct sock *sk = (struct sock *)msk;
> + int ret;
> +
> + ret = ipv6_setsockopt(sk, SOL_IPV6, optname, optval, optlen);
> + if (ret)
> + return ret;
> +
> + lock_sock(sk);
> + ret = mptcp_setsockopt_all_sf(msk, SOL_IPV6, optname, optval, optlen);
> + release_sock(sk);
> + return ret;
> +}
> +#endif
Maybe you could have one generic helper to call xxx_setsockopt() on the
MPTCP socket, and then call mptcp_setsockopt_all_sf(). You can pass the
level, and call the right function.
(...)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-05-01 15:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 22:33 [PATCH mptcp-next v3 0/3] mptcp: MSG_ERRQUEUE support on the parent socket David Carlier
2026-04-21 22:33 ` [PATCH mptcp-next v3 1/3] mptcp: propagate RECVERR sockopts to subflows David Carlier
2026-04-22 8:05 ` Paolo Abeni
2026-04-22 8:32 ` Matthieu Baerts
2026-04-22 8:35 ` Matthieu Baerts
2026-04-22 8:36 ` Matthieu Baerts
2026-04-22 8:48 ` Paolo Abeni
2026-04-22 8:50 ` Matthieu Baerts
2026-04-22 13:53 ` Paolo Abeni
2026-04-22 21:51 ` David CARLIER
2026-04-27 17:07 ` Matthieu Baerts
2026-04-21 22:33 ` [PATCH mptcp-next v3 2/3] mptcp: support MSG_ERRQUEUE on the parent socket David Carlier
2026-04-22 8:28 ` Paolo Abeni
2026-04-22 21:54 ` David CARLIER
2026-04-21 22:33 ` [PATCH mptcp-next v3 3/3] selftests: mptcp: cover IP_RECVERR sockopt propagation David Carlier
2026-04-21 23:38 ` [PATCH mptcp-next v3 0/3] mptcp: MSG_ERRQUEUE support on the parent socket MPTCP CI
2026-04-22 8:22 ` Matthieu Baerts
2026-04-22 8:56 ` David CARLIER
2026-04-27 21:10 ` [PATCH mptcp-next v4 0/4] " David Carlier
2026-04-27 21:10 ` [PATCH mptcp-next v4 1/4] mptcp: sockopt: factor inet_flags propagation into a mask David Carlier
2026-04-27 21:10 ` [PATCH mptcp-next v4 2/4] mptcp: propagate RECVERR sockopts to subflows David Carlier
2026-05-01 15:56 ` Matthieu Baerts [this message]
2026-04-27 21:10 ` [PATCH mptcp-next v4 3/4] mptcp: support MSG_ERRQUEUE on the parent socket David Carlier
2026-04-27 21:10 ` [PATCH mptcp-next v4 4/4] selftests: mptcp: cover IP_RECVERR sockopt propagation David Carlier
2026-04-28 18:48 ` [PATCH mptcp-next v4 0/4] mptcp: MSG_ERRQUEUE support on the parent socket Matthieu Baerts
2026-04-28 18:56 ` Matthieu Baerts
2026-04-28 19:15 ` David CARLIER
2026-05-01 14:49 ` Matthieu Baerts
2026-05-01 15:28 ` David CARLIER
2026-05-01 15:56 ` Matthieu Baerts
2026-04-28 19:48 ` MPTCP CI
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=b9eb46be-0916-4932-b9d2-165eea2aeb6b@kernel.org \
--to=matttbe@kernel.org \
--cc=devnexen@gmail.com \
--cc=geliang@kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--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 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.