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

* Re: [PATCH iproute2] bridge: fdb: add an error print for unknown command
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2023-10-10 18:52 UTC (permalink / raw)
  To: Amit Cohen, netdev; +Cc: mlxsw, dsahern, stephen, roopa

On 10/10/23 12:57, Amit Cohen 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.
> 
> 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++;
>   	}

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>

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

* Re: [PATCH iproute2] bridge: fdb: add an error print for unknown command
  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
  1 sibling, 1 reply; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-13  2:40 UTC (permalink / raw)
  To: Amit Cohen; +Cc: netdev, mlxsw, dsahern, stephen, razor, roopa

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

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.
> 
> 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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* RE: [PATCH iproute2] bridge: fdb: add an error print for unknown command
  2023-10-13  2:40 ` patchwork-bot+netdevbpf
@ 2023-10-16  6:36   ` Amit Cohen
  2023-10-16 16:19     ` David Ahern
  0 siblings, 1 reply; 6+ messages in thread
From: Amit Cohen @ 2023-10-16  6:36 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, mlxsw, stephen, razor, Roopa Prabhu

> -----Original Message-----
> From: patchwork-bot+netdevbpf@kernel.org <patchwork-
> bot+netdevbpf@kernel.org>
> Sent: Friday, 13 October 2023 5:40
> To: Amit Cohen <amcohen@nvidia.com>
> Cc: netdev@vger.kernel.org; mlxsw <mlxsw@nvidia.com>;
> dsahern@gmail.com; stephen@networkplumber.org; razor@blackwall.org;
> Roopa Prabhu <roopa@nvidia.com>
> 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 <stephen@networkplumber.org>:
> 
> 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.
> >
> > 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=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


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

* Re: [PATCH iproute2] bridge: fdb: add an error print for unknown command
  2023-10-16  6:36   ` Amit Cohen
@ 2023-10-16 16:19     ` David Ahern
  2023-10-17  7:01       ` Amit Cohen
  0 siblings, 1 reply; 6+ messages in thread
From: David Ahern @ 2023-10-16 16:19 UTC (permalink / raw)
  To: Amit Cohen; +Cc: netdev, mlxsw, stephen, razor, Roopa Prabhu

On 10/16/23 12:36 AM, Amit Cohen wrote:
> 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


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

* RE: [PATCH iproute2] bridge: fdb: add an error print for unknown command
  2023-10-16 16:19     ` David Ahern
@ 2023-10-17  7:01       ` Amit Cohen
  0 siblings, 0 replies; 6+ messages in thread
From: Amit Cohen @ 2023-10-17  7:01 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, mlxsw, stephen, razor, Roopa Prabhu



> -----Original Message-----
> From: David Ahern <dsahern@gmail.com>
> Sent: Monday, 16 October 2023 19:19
> To: Amit Cohen <amcohen@nvidia.com>
> Cc: netdev@vger.kernel.org; mlxsw <mlxsw@nvidia.com>;
> stephen@networkplumber.org; razor@blackwall.org; Roopa Prabhu
> <roopa@nvidia.com>
> Subject: Re: [PATCH iproute2] bridge: fdb: add an error print for unknown
> command
> 
> On 10/16/23 12:36 AM, Amit Cohen wrote:
> > 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!


^ permalink raw reply	[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).