Skip to contentSkip to conversation

bridge: fdb: add an error print for unknown command

PATCH Applied Amit Cohen 4 participants 6 messages Oct 10, 2023 – Oct 17, 2023

Subsystems (2)
lore
Share & tools
lore

Amit Cohen

author
#0 lore raw

PATCH 1/1 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")
---
 bridge/fdb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
bridge/fdb.c +6 -2
index ae8f7b46..d7ef26fd 100644
@@ -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++;
 	}
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 27 lines · 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")
---
  bridge/fdb.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
bridge/fdb.c +2 -0
index ae8f7b46..d7ef26fd 100644
@@ -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();

bridge/fdb.c static int fdb_flush(int argc, char **argv) · line 773

Quoted 10 lines
bridge/fdb.c +4 -2
  		} else {
-			if (strcmp(*argv, "help") == 0)
-				NEXT_ARG();
+			fprintf(stderr, "bridge fdb: unknown command \"%s\"?\n",
+				*argv);
+			usage();
+			return -1;
  		}
  		argc--; argv++;
  	}
#2 lore raw
In reply to Amit Cohen
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 4 lines · On Tue, 10 Oct 2023 12:57:50 +0300 you wrote:

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.

Quoted 8 lines

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.

[...]

Here is the summary with links:
- [iproute2] bridge: fdb: add an error print for unknown command

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f1160a0f6bb3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
author
#3 lore raw
Quoted 35 lines

-----Original Message-----
From: [email protected] <patchwork- [email protected]>
Sent: Friday, 13 October 2023 5:40
To: Amit Cohen <[email protected]>
Cc: [email protected]; mlxsw <[email protected]>; [email protected]; [email protected]; [email protected]; Roopa Prabhu <[email protected]>
Subject: Re: [PATCH iproute2] bridge: fdb: add an error print for unknown command

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 1 line · On Tue, 10 Oct 2023 12:57:50 +0300 you wrote:

Commit 6e1ca489c5a2 ("bridge: fdb: add new flush command") added

support

Quoted 7 lines

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

Quoted 4 lines

works, although the iproute-2 version is too old and it does not send VXLAN attributes to the kernel.

[...]

Here is the summary with links:
- [iproute2] bridge: fdb: add an error print for unknown command

Quoted 8 lines

https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f
1160a0f6bb3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Hi David,
Can you please merge it to iproute2-next?
I want to send patch-set to extend "flush" command.

Thanks,
Amit

#4 lore raw
Quoted 4 lines · Amit Cohen

Hi David,
Can you please merge it to iproute2-next?
I want to send patch-set to extend "flush" command.

done - merged main into next

author
#5 lore raw
Quoted 12 lines

-----Original Message-----
From: David Ahern <[email protected]>
Sent: Monday, 16 October 2023 19:19
To: Amit Cohen <[email protected]>
Cc: [email protected]; mlxsw <[email protected]>; [email protected]; [email protected]; Roopa Prabhu <[email protected]>
Subject: Re: [PATCH iproute2] bridge: fdb: add an error print for unknown command

Quoted 7 lines
Quoted 4 lines · Amit Cohen

Hi David,
Can you please merge it to iproute2-next?
I want to send patch-set to extend "flush" command.

done - merged main into next

Thanks!