[PATCH mptcp-next] mptcp: add fullmesh flag check for adding address

Geliang Tang posted 1 patch 2 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/02d082c77c58ed6400d319d40e719a4ebe4e7942.1645419055.git.geliang.tang@suse.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <mathew.j.martineau@linux.intel.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_netlink.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
Posted by Geliang Tang 2 years, 2 months ago
The fullmesh flag mustn't be used with the signal flag when adding an
address. This patch added the necessary flags check for this case.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/pm_netlink.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index a0e7d5b7e22f..e3b0384ff79a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1253,6 +1253,12 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info)
 		return -EINVAL;
 	}
 
+	if (addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
+	    addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
+		GENL_SET_ERR_MSG(info, "flags mustn't have both signal and fullmesh");
+		return -EINVAL;
+	}
+
 	if (addr.flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) {
 		GENL_SET_ERR_MSG(info, "can't create IMPLICIT endpoint");
 		return -EINVAL;
-- 
2.34.1


Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
Posted by Mat Martineau 2 years, 2 months ago
On Mon, 21 Feb 2022, Geliang Tang wrote:

> The fullmesh flag mustn't be used with the signal flag when adding an
> address. This patch added the necessary flags check for this case.
>

Hi Geliang -

What happens if FULLMESH and SIGNAL are used together with the existing 
code? Is this a patch that should go to -net with a Fixes: tag?

-Mat


> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/pm_netlink.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index a0e7d5b7e22f..e3b0384ff79a 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1253,6 +1253,12 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info)
> 		return -EINVAL;
> 	}
>
> +	if (addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
> +	    addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
> +		GENL_SET_ERR_MSG(info, "flags mustn't have both signal and fullmesh");
> +		return -EINVAL;
> +	}
> +
> 	if (addr.flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) {
> 		GENL_SET_ERR_MSG(info, "can't create IMPLICIT endpoint");
> 		return -EINVAL;
> -- 
> 2.34.1
>
>
>

--
Mat Martineau
Intel

Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
Posted by Mat Martineau 2 years, 2 months ago
On Tue, 22 Feb 2022, Mat Martineau wrote:

> On Mon, 21 Feb 2022, Geliang Tang wrote:
>
>> The fullmesh flag mustn't be used with the signal flag when adding an
>> address. This patch added the necessary flags check for this case.
>> 
>
> Hi Geliang -
>
> What happens if FULLMESH and SIGNAL are used together with the existing code? 
> Is this a patch that should go to -net with a Fixes: tag?
>

Nevermind about the -net question, I see "mptcp: set fullmesh flag in 
pm_netlink" is only in net-next. Also, the check is already in 
mtpcp_nl_cmd_set_flags(), so this is adding similar code to 
mptcp_cmd_add_addr().

Looks good to me:

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

>> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
>> ---
>> net/mptcp/pm_netlink.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
>> index a0e7d5b7e22f..e3b0384ff79a 100644
>> --- a/net/mptcp/pm_netlink.c
>> +++ b/net/mptcp/pm_netlink.c
>> @@ -1253,6 +1253,12 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff 
>> *skb, struct genl_info *info)
>> 		return -EINVAL;
>> 	}
>> 
>> +	if (addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
>> +	    addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
>> +		GENL_SET_ERR_MSG(info, "flags mustn't have both signal and 
>> fullmesh");
>> +		return -EINVAL;
>> +	}
>> +
>> 	if (addr.flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) {
>> 		GENL_SET_ERR_MSG(info, "can't create IMPLICIT endpoint");
>> 		return -EINVAL;
>> -- 
>> 2.34.1
>> 
>> 
>> 
>
> --
> Mat Martineau
> Intel
>
>

--
Mat Martineau
Intel

Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
Posted by Geliang Tang 2 years, 2 months ago
On Tue, Feb 22, 2022 at 04:52:40PM -0800, Mat Martineau wrote:
> On Mon, 21 Feb 2022, Geliang Tang wrote:
> 
> > The fullmesh flag mustn't be used with the signal flag when adding an
> > address. This patch added the necessary flags check for this case.
> > 
> 
> Hi Geliang -
> 
> What happens if FULLMESH and SIGNAL are used together with the existing
> code? Is this a patch that should go to -net with a Fixes: tag?

Hi Mat,

If 'fullmesh' is used with 'signal', 'fullmesh' will not take effect.
Since there's no address signal mechanism to send the fullmesh flag to
the peer. We only deal the fullmesh flag with local addresses.

Thanks,
-Geliang

> 
> -Mat
> 
> 
> > Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> > ---
> > net/mptcp/pm_netlink.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> > 
> > diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> > index a0e7d5b7e22f..e3b0384ff79a 100644
> > --- a/net/mptcp/pm_netlink.c
> > +++ b/net/mptcp/pm_netlink.c
> > @@ -1253,6 +1253,12 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info)
> > 		return -EINVAL;
> > 	}
> > 
> > +	if (addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
> > +	    addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
> > +		GENL_SET_ERR_MSG(info, "flags mustn't have both signal and fullmesh");
> > +		return -EINVAL;
> > +	}
> > +
> > 	if (addr.flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) {
> > 		GENL_SET_ERR_MSG(info, "can't create IMPLICIT endpoint");
> > 		return -EINVAL;
> > -- 
> > 2.34.1
> > 
> > 
> > 
> 
> --
> Mat Martineau
> Intel
> 


Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
Posted by Matthieu Baerts 2 years, 2 months ago
Hi Geliang, Mat,

On 21/02/2022 05:51, Geliang Tang wrote:
> The fullmesh flag mustn't be used with the signal flag when adding an
> address. This patch added the necessary flags check for this case.

Thank you for the patch and the review!

- a52bfb47e95a: mptcp: add fullmesh flag check for adding address
- Results: 067a741aa5fb..5db573b4c7ff

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220223T210614
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net