[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220225095154.7232777b@hermes.local>
Date: Fri, 25 Feb 2022 09:51:54 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, David Ahern <dsahern@...nel.org>,
Petr Machata <petrm@...dia.com>
Subject: Re: [PATCH iproute2] dcb: fix broken "show default-prio"
On Fri, 25 Feb 2022 19:12:58 +0200
Vladimir Oltean <vladimir.oltean@....com> wrote:
> Although "dcb app show dev eth0 default-prio" is documented as a valid
> command in the help text, it doesn't work because the parser for the
> "show" command doesn't parse "default-prio". Fix this by establishing
> the linkage between the sub-command parsing code and
> dcb_app_print_default_prio() - which was previously only called from
> dcb_app_print().
>
> Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
> dcb/dcb_app.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
> index 6bd64bbed0cc..c135e73acb76 100644
> --- a/dcb/dcb_app.c
> +++ b/dcb/dcb_app.c
> @@ -646,6 +646,8 @@ static int dcb_cmd_app_show(struct dcb *dcb, const char *dev, int argc, char **a
> if (matches(*argv, "help") == 0) {
> dcb_app_help_show_flush();
> goto out;
> + } else if (matches(*argv, "default-prio") == 0) {
> + dcb_app_print_default_prio(&tab);
> } else if (matches(*argv, "ethtype-prio") == 0) {
> dcb_app_print_ethtype_prio(&tab);
> } else if (matches(*argv, "dscp-prio") == 0) {
This is an example of why matches() sucks.
If we add this patch, then the result of command where *argv == "d"
will change.
All those argument handling should be using strcmp() instead.
Should have required that before merging dcb. David and I should
have caught that, too late now.
Powered by blists - more mailing lists