netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] bridge: fdb: add an error print for unknown command
@ 2023-10-10  9:57 Amit Cohen
  2023-10-10 18:52 ` Nikolay Aleksandrov
  2023-10-13  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Amit Cohen @ 2023-10-10  9:57 UTC (permalink / raw)
  To: netdev; +Cc: mlxsw, dsahern, stephen, razor, roopa, Amit Cohen

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


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

end of thread, other threads:[~2023-10-17  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10  9:57 [PATCH iproute2] bridge: fdb: add an error print for unknown command Amit Cohen
2023-10-10 18:52 ` 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

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).