[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2417961c-cb35-2dec-ce94-884afd636f24@kernel.org>
Date: Fri, 12 Jan 2024 10:58:42 -0800 (PST)
From: Mat Martineau <martineau@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Matthieu Baerts <matttbe@...nel.org>,
Geliang Tang <geliang.tang@...ux.dev>, Florian Westphal <fw@...len.de>,
netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net 5/5] mptcp: refine opt_mp_capable determination
On Thu, 11 Jan 2024, Eric Dumazet wrote:
> OPTIONS_MPTCP_MPC is a combination of three flags.
>
> It would be better to be strict about testing what
> flag is expected, at least for code readability.
>
> mptcp_parse_option() already makes the distinction.
>
> - subflow_check_req() should use OPTION_MPTCP_MPC_SYN.
>
> - mptcp_subflow_init_cookie_req() should use OPTION_MPTCP_MPC_ACK.
>
> - subflow_finish_connect() should use OPTION_MPTCP_MPC_SYNACK
>
> - subflow_syn_recv_sock should use OPTION_MPTCP_MPC_ACK
>
Should this be applied to net-next?
If intended for -net, I think
Fixes: 74c7dfbee3e1 ("mptcp: consolidate in_opt sub-options fields in a bitmask")
is the appropriate commit to reference.
- Mat
> Suggested-by: Paolo Abeni <pabeni@...hat.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> net/mptcp/subflow.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index 13039ac8d1ab641fb9b22b621ac011e6a7bc9e37..1117d1e84274a5ea1ede990566f67c0073fd86a0 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -157,7 +157,7 @@ static int subflow_check_req(struct request_sock *req,
>
> mptcp_get_options(skb, &mp_opt);
>
> - opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
> + opt_mp_capable = !!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYN);
> opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_SYN);
> if (opt_mp_capable) {
> SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_MPCAPABLEPASSIVE);
> @@ -254,7 +254,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req,
> subflow_init_req(req, sk_listener);
> mptcp_get_options(skb, &mp_opt);
>
> - opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
> + opt_mp_capable = !!(mp_opt.suboptions & OPTION_MPTCP_MPC_ACK);
> opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK);
> if (opt_mp_capable && opt_mp_join)
> return -EINVAL;
> @@ -486,7 +486,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
>
> mptcp_get_options(skb, &mp_opt);
> if (subflow->request_mptcp) {
> - if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPC)) {
> + if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYNACK)) {
> MPTCP_INC_STATS(sock_net(sk),
> MPTCP_MIB_MPCAPABLEACTIVEFALLBACK);
> mptcp_do_fallback(sk);
> @@ -783,7 +783,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
> * options.
> */
> mptcp_get_options(skb, &mp_opt);
> - if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPC))
> + if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_ACK))
> fallback = true;
>
> } else if (subflow_req->mp_join) {
> --
> 2.43.0.275.g3460e3d667-goog
>
>
Powered by blists - more mailing lists