From: Amit Cohen Date: Tue, 10 Oct 2023 09:57:50 +0000 (+0300) Subject: bridge: fdb: add an error print for unknown command X-Git-Tag: v6.6.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1160a0f6bb3bbd012447e955c13bc7591f4f3a8;p=thirdparty%2Fiproute2.git bridge: fdb: add an error print for unknown command 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 Acked-by: Nikolay Aleksandrov Signed-off-by: Stephen Hemminger --- diff --git a/bridge/fdb.c b/bridge/fdb.c index ae8f7b469..d7ef26fd7 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++; }