* [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open
@ 2021-09-22 13:56 Davide Caratti
2021-09-22 22:32 ` Mat Martineau
2021-09-23 16:38 ` Matthieu Baerts
0 siblings, 2 replies; 3+ messages in thread
From: Davide Caratti @ 2021-09-22 13:56 UTC (permalink / raw)
To: mptcp, Geliang Tang, Mat Martineau
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);
if (bkup)
entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
else
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open
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
2021-09-23 16:38 ` Matthieu Baerts
1 sibling, 0 replies; 3+ messages in thread
From: Mat Martineau @ 2021-09-22 22:32 UTC (permalink / raw)
To: Davide Caratti; +Cc: mptcp, Geliang Tang
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open
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
@ 2021-09-23 16:38 ` Matthieu Baerts
1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2021-09-23 16:38 UTC (permalink / raw)
To: Davide Caratti, Mat Martineau; +Cc: mptcp, Geliang Tang
Hi Davide, Mat,
On 22/09/2021 15:56, 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>
Thank you for the patch and the review!
Now in our tree (fix for -net)!
- 060daf584b27: mptcp: allow changing the 'backup' bit when no sockets
are open
- Results: eb5a9ba15e16..b84c295b0ad7
Builds and tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210923T163816
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210923T163816
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-23 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-09-23 16:38 ` Matthieu Baerts
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.