From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH v2 mptcp-next] Squash to "mptcp: add rm_list_tx in mptcp_pm_data"
Date: Thu, 18 Feb 2021 17:14:54 -0800 [thread overview]
Message-ID: <2776e3c-1f2a-38db-63ec-2f508bb9af55@linux.intel.com> (raw)
In-Reply-To: a288a61577bc79178e8ebb8aad8cb24a5d5ee5ae.1613617491.git.geliangtang@gmail.com
[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]
On Thu, 18 Feb 2021, Geliang Tang wrote:
> Fix the length of RM_ADDR suboption in mptcp_pm_rm_addr_signal.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> v2:
> - clear msk->pm.addr_signal in the error case.
> ---
> net/mptcp/pm.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 32f203f186a2..f3db3adfe3fc 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -260,7 +260,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
> bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
> struct mptcp_rm_list *rm_list)
> {
> - int ret = false;
> + int ret = false, len;
>
> spin_lock_bh(&msk->pm.lock);
>
> @@ -268,7 +268,12 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
> if (!mptcp_pm_should_rm_signal(msk))
> goto out_unlock;
>
> - if (remaining < TCPOLEN_MPTCP_RM_ADDR_BASE)
> + len = mptcp_rm_addr_len(msk->pm.rm_list_tx);
> + if (len < 0) {
> + WRITE_ONCE(msk->pm.addr_signal, 0);
> + goto out_unlock;
> + }
> + if (remaining < len)
> goto out_unlock;
>
> *rm_list = msk->pm.rm_list_tx;
> --
> 2.29.2
Thanks for the v2, looks ready to squash.
--
Mat Martineau
Intel
next reply other threads:[~2021-02-19 1:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 1:14 Mat Martineau [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-22 17:10 [MPTCP] Re: [MPTCP][PATCH v2 mptcp-next] Squash to "mptcp: add rm_list_tx in mptcp_pm_data" 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=2776e3c-1f2a-38db-63ec-2f508bb9af55@linux.intel.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox