All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <martineau@kernel.org>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-net] mptcp: add validity check for sending RM_ADDR
Date: Mon, 6 Nov 2023 17:07:45 -0800 (PST)	[thread overview]
Message-ID: <aced43b2-0ece-264f-a314-698ccb2299da@kernel.org> (raw)
In-Reply-To: <02d38d6b7a98765bf516c90541d4f2a911f428ce.1699014584.git.geliang.tang@suse.com>

On Fri, 3 Nov 2023, Geliang Tang wrote:

> This patch adds the validity check for sending RM_ADDRs for userspace PM
> in mptcp_pm_remove_addrs(), only send a RM_ADDR when the address is in the
> anno_list or conn_list.
>
> Fixes: 8b1c94da1e48 ("mptcp: only send RM_ADDR in nl_cmd_remove")
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/pm_netlink.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 1529ec358815..bf4d96f6f99a 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1515,8 +1515,9 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
> 	struct mptcp_pm_addr_entry *entry;
>
> 	list_for_each_entry(entry, rm_list, list) {
> -		remove_anno_list_by_saddr(msk, &entry->addr);
> -		if (alist.nr < MPTCP_RM_IDS_MAX)
> +		if ((remove_anno_list_by_saddr(msk, &entry->addr) ||
> +		     lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) &&
> +		    alist.nr < MPTCP_RM_IDS_MAX)
> 			alist.ids[alist.nr++] = entry->addr.id;
> 	}

Looks good to me, thanks Geliang.

Reviewed-by: Mat Martineau <martineau@kernel.org>


  parent reply	other threads:[~2023-11-07  1:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 12:31 [PATCH mptcp-net] mptcp: add validity check for sending RM_ADDR Geliang Tang
2023-11-03 14:25 ` mptcp: add validity check for sending RM_ADDR: Tests Results MPTCP CI
2023-11-07  1:07 ` Mat Martineau [this message]
2023-11-07  2:20 ` MPTCP CI
2023-11-07 21:24 ` [PATCH mptcp-net] mptcp: add validity check for sending RM_ADDR 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=aced43b2-0ece-264f-a314-698ccb2299da@kernel.org \
    --to=martineau@kernel.org \
    --cc=geliang.tang@suse.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.