All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Davide Caratti <dcaratti@redhat.com>
Cc: mptcp@lists.linux.dev, Geliang Tang <geliangtang@gmail.com>
Subject: Re: [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open
Date: Wed, 22 Sep 2021 15:32:50 -0700 (PDT)	[thread overview]
Message-ID: <6f5df69-cffa-6d5d-a957-f93f2ff0e9b6@linux.intel.com> (raw)
In-Reply-To: <6fada33a17044e54f0ba5b3a5dc35987cbea3b54.1632318877.git.dcaratti@redhat.com>

On Wed, 22 Sep 2021, Davide Caratti wrote:

> current Linux refuses to change the 'backup' bit of MPTCP endpoints, i.e.
> using MPTCP_PM_CMD_SET_FLAGS, unless it finds (at least) one subflow that
> matches the endpoint address. There is no reason for that, so we can just
> ignore the return value of mptcp_nl_addr_backup(). In this way, endpoints
> can reconfigure their 'backup' flag even if no MPTCP sockets are open (or
> more generally, in case the MP_PRIO message is not sent out).
>
> Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink")
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
> ---
>
> Notes:
>    v2:
>     - ignore the return value of mptcp_nl_addr_backup() rather than just
>       gixing the case of 0 open sockets, from Mat Martineau
>
> net/mptcp/pm_netlink.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index c4f9a5ce3815..c3722eedc671 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1718,10 +1718,7 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
>
> 	list_for_each_entry(entry, &pernet->local_addr_list, list) {
> 		if (addresses_equal(&entry->addr, &addr.addr, true)) {
> -			ret = mptcp_nl_addr_backup(net, &entry->addr, bkup);
> -			if (ret)
> -				return ret;
> -
> +			mptcp_nl_addr_backup(net, &entry->addr, bkup);

Strictly speaking, should leave a blank line before this 'if' statement, 
but other than that it looks good. I can fix it up before sending to 
netdev.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> 			if (bkup)
> 				entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
> 			else
> -- 
> 2.31.1
>
>

--
Mat Martineau
Intel

  reply	other threads:[~2021-09-22 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 13:56 [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open Davide Caratti
2021-09-22 22:32 ` Mat Martineau [this message]
2021-09-23 16:38 ` 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=6f5df69-cffa-6d5d-a957-f93f2ff0e9b6@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=dcaratti@redhat.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.