All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliang.tang@suse.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	David Ahern <dsahern@kernel.org>
Cc: Geliang Tang <geliang.tang@suse.com>,
	netdev@vger.kernel.org, mptcp@lists.linux.dev,
	Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH iproute2-next v3 1/3] mptcp: add fullmesh check for adding address
Date: Wed, 23 Feb 2022 14:50:37 +0800	[thread overview]
Message-ID: <a452307d79abca899d35dce03de4fc5bbffb965e.1645598911.git.geliang.tang@suse.com> (raw)
In-Reply-To: <cover.1645598911.git.geliang.tang@suse.com>

The fullmesh flag mustn't be used with the signal flag when adding an
address. Commands like this should be treated as invalid commands:

 ip mptcp endpoint add 10.0.2.1 signal fullmesh

This patch added the necessary flags check for this case.

Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 ip/ipmptcp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index eef7c6f4..5682c7df 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -116,6 +116,11 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd)
 	ll_init_map(&rth);
 	while (argc > 0) {
 		if (get_flags(*argv, &flags) == 0) {
+			if (adding &&
+			    (flags & MPTCP_PM_ADDR_FLAG_SIGNAL) &&
+			    (flags & MPTCP_PM_ADDR_FLAG_FULLMESH))
+				invarg("flags mustn't have both signal and fullmesh", *argv);
+
 			/* allow changing the 'backup' flag only */
 			if (cmd == MPTCP_PM_CMD_SET_FLAGS &&
 			    (flags & ~MPTCP_PM_ADDR_FLAG_BACKUP))
-- 
2.34.1


  reply	other threads:[~2022-02-23  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  6:50 [PATCH iproute2-next v3 0/3] mptcp: add the fullmesh flag setting support Geliang Tang
2022-02-23  6:50 ` Geliang Tang [this message]
2022-02-23  6:50 ` [PATCH iproute2-next v3 2/3] mptcp: add fullmesh support for setting flags Geliang Tang
2022-02-23  6:50 ` [PATCH iproute2-next v3 3/3] mptcp: add port " Geliang Tang

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=a452307d79abca899d35dce03de4fc5bbffb965e.1645598911.git.geliang.tang@suse.com \
    --to=geliang.tang@suse.com \
    --cc=dsahern@kernel.org \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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.