netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amit Cohen <amcohen@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <mlxsw@nvidia.com>, <dsahern@gmail.com>,
	<stephen@networkplumber.org>, <razor@blackwall.org>,
	<roopa@nvidia.com>, Amit Cohen <amcohen@nvidia.com>
Subject: [PATCH iproute2] bridge: fdb: add an error print for unknown command
Date: Tue, 10 Oct 2023 12:57:50 +0300	[thread overview]
Message-ID: <20231010095750.2975206-1-amcohen@nvidia.com> (raw)

Commit 6e1ca489c5a2 ("bridge: fdb: add new flush command") added support
for "bridge fdb flush" command. This commit did not handle unsupported
keywords, they are just ignored.

Add an error print to notify the user when a keyword which is not supported
is used. The kernel will be extended to support flush with VXLAN device,
so new attributes will be supported (e.g., vni, port). When iproute-2 does
not warn for unsupported keyword, user might think that the flush command
works, although the iproute-2 version is too old and it does not send VXLAN
attributes to the kernel.

Fixes: 6e1ca489c5a2 ("bridge: fdb: add new flush command")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
---
 bridge/fdb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bridge/fdb.c b/bridge/fdb.c
index ae8f7b46..d7ef26fd 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -761,9 +761,13 @@ static int fdb_flush(int argc, char **argv)
 				duparg2("vlan", *argv);
 			NEXT_ARG();
 			vid = atoi(*argv);
+		} else if (strcmp(*argv, "help") == 0) {
+			NEXT_ARG();
 		} else {
-			if (strcmp(*argv, "help") == 0)
-				NEXT_ARG();
+			fprintf(stderr, "bridge fdb: unknown command \"%s\"?\n",
+				*argv);
+			usage();
+			return -1;
 		}
 		argc--; argv++;
 	}
-- 
2.40.1


             reply	other threads:[~2023-10-10  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10  9:57 Amit Cohen [this message]
2023-10-10 18:52 ` [PATCH iproute2] bridge: fdb: add an error print for unknown command Nikolay Aleksandrov
2023-10-13  2:40 ` patchwork-bot+netdevbpf
2023-10-16  6:36   ` Amit Cohen
2023-10-16 16:19     ` David Ahern
2023-10-17  7:01       ` Amit Cohen

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=20231010095750.2975206-1-amcohen@nvidia.com \
    --to=amcohen@nvidia.com \
    --cc=dsahern@gmail.com \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).