net/mptcp/pm_netlink.c | 6 ++++++ 1 file changed, 6 insertions(+)
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
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
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
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 >
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
© 2016 - 2024 Red Hat, Inc.