All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliangtang@gmail.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: add csum_reqd in mptcp_options_received"
Date: Mon, 10 May 2021 17:48:01 -0700 (PDT)	[thread overview]
Message-ID: <92d1e9-e495-56e1-119c-d49fb6d3e9f@linux.intel.com> (raw)
In-Reply-To: <9d886bb5015a687a46287accd3a6f1111233eda7.1620349765.git.geliangtang@gmail.com>

On Fri, 7 May 2021, Geliang Tang wrote:

> Init csum_reqd in mptcp_get_options, keep mptcp_parse_option unchanged.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/options.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)

Looks good to me, thanks.

-Mat


>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 4a74b8bb737f..527affbbeea9 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -24,8 +24,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
> 			       const unsigned char *ptr, int opsize,
> 			       struct mptcp_options_received *mp_opt)
> {
> -	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
> -	struct mptcp_sock *msk = mptcp_sk(subflow->conn);
> 	u8 subtype = *ptr >> 4;
> 	int expected_opsize;
> 	u8 version;
> @@ -74,7 +72,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
> 		 * negotiated, the receiver MUST close the subflow with a RST as
> 		 * it is considered broken."
> 		 */
> -		mp_opt->csum_reqd = READ_ONCE(msk->csum_enabled);
> 		if (flags & MPTCP_CAP_CHECKSUM_REQD)
> 			mp_opt->csum_reqd = 1;
>
> @@ -329,6 +326,8 @@ void mptcp_get_options(const struct sock *sk,
> 		       const struct sk_buff *skb,
> 		       struct mptcp_options_received *mp_opt)
> {
> +	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
> +	struct mptcp_sock *msk = mptcp_sk(subflow->conn);
> 	const struct tcphdr *th = tcp_hdr(skb);
> 	const unsigned char *ptr;
> 	int length;
> @@ -344,7 +343,7 @@ void mptcp_get_options(const struct sock *sk,
> 	mp_opt->dss = 0;
> 	mp_opt->mp_prio = 0;
> 	mp_opt->reset = 0;
> -	mp_opt->csum_reqd = 0;
> +	mp_opt->csum_reqd = READ_ONCE(msk->csum_enabled);
>
> 	length = (th->doff * 4) - sizeof(struct tcphdr);
> 	ptr = (const unsigned char *)(th + 1);
> -- 
> 2.31.1
>
>
>

--
Mat Martineau
Intel

  reply	other threads:[~2021-05-11  0:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  1:12 [MPTCP][PATCH mptcp-next] Squash to "mptcp: add sk parameter for mptcp_parse_option" Geliang Tang
2021-05-07  1:12 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: add csum_reqd in mptcp_options_received" Geliang Tang
2021-05-11  0:48   ` Mat Martineau [this message]
2021-05-13  7:32   ` Matthieu Baerts
2021-05-11  0:47 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: add sk parameter for mptcp_parse_option" Mat Martineau
2021-05-13  7:29 ` Matthieu Baerts

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=92d1e9-e495-56e1-119c-d49fb6d3e9f@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=geliangtang@gmail.com \
    --cc=mptcp@lists.linux.dev \
    /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.