[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sfs6d434.fsf@nvidia.com>
Date: Fri, 25 Feb 2022 22:30:38 +0100
From: Petr Machata <petrm@...dia.com>
To: Stephen Hemminger <stephen@...workplumber.org>
CC: Vladimir Oltean <vladimir.oltean@....com>,
<netdev@...r.kernel.org>, David Ahern <dsahern@...nel.org>,
Petr Machata <petrm@...dia.com>
Subject: Re: [PATCH iproute2] dcb: fix broken "show default-prio"
Stephen Hemminger <stephen@...workplumber.org> writes:
> On Fri, 25 Feb 2022 19:12:58 +0200
> Vladimir Oltean <vladimir.oltean@....com> wrote:
>
>> 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) {
A fix along these lines got merged recently:
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=924f6b4a5d2b
> This is an example of why matches() sucks.
> If we add this patch, then the result of command where *argv == "d"
> will change.
To further drive this point, I made the exact same mistake in v1 of my
patch.
Powered by blists - more mailing lists