]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fdb: add an error print for unknown command
authorAmit Cohen <amcohen@nvidia.com>
Tue, 10 Oct 2023 09:57:50 +0000 (12:57 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 13 Oct 2023 02:34:40 +0000 (19:34 -0700)
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>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/fdb.c

index ae8f7b4690f9f39cc0dea6b2380a417e1cc0c756..d7ef26fd75b80fc31ea3909eb34cfb074460a234 100644 (file)
@@ -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++;
        }