All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
@ 2022-02-21  4:51 Geliang Tang
  2022-02-23  0:52 ` Mat Martineau
  2022-02-23 21:06 ` Matthieu Baerts
  0 siblings, 2 replies; 5+ messages in thread
From: Geliang Tang @ 2022-02-21  4:51 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
  2022-02-21  4:51 [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address Geliang Tang
@ 2022-02-23  0:52 ` Mat Martineau
  2022-02-23  1:01   ` Mat Martineau
  2022-02-23 23:51   ` Geliang Tang
  2022-02-23 21:06 ` Matthieu Baerts
  1 sibling, 2 replies; 5+ messages in thread
From: Mat Martineau @ 2022-02-23  0:52 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
  2022-02-23  0:52 ` Mat Martineau
@ 2022-02-23  1:01   ` Mat Martineau
  2022-02-23 23:51   ` Geliang Tang
  1 sibling, 0 replies; 5+ messages in thread
From: Mat Martineau @ 2022-02-23  1:01 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
  2022-02-21  4:51 [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address Geliang Tang
  2022-02-23  0:52 ` Mat Martineau
@ 2022-02-23 21:06 ` Matthieu Baerts
  1 sibling, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2022-02-23 21:06 UTC (permalink / raw)
  To: Geliang Tang, mptcp

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address
  2022-02-23  0:52 ` Mat Martineau
  2022-02-23  1:01   ` Mat Martineau
@ 2022-02-23 23:51   ` Geliang Tang
  1 sibling, 0 replies; 5+ messages in thread
From: Geliang Tang @ 2022-02-23 23:51 UTC (permalink / raw)
  To: Mat Martineau; +Cc: mptcp

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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-23 23:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21  4:51 [PATCH mptcp-next] mptcp: add fullmesh flag check for adding address Geliang Tang
2022-02-23  0:52 ` Mat Martineau
2022-02-23  1:01   ` Mat Martineau
2022-02-23 23:51   ` Geliang Tang
2022-02-23 21:06 ` 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.