[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231115075921.198fad24@hermes.local>
Date: Wed, 15 Nov 2023 07:59:21 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Petr Machata <petrm@...dia.com>
Cc: David Ahern <dsahern@...il.com>, <netdev@...r.kernel.org>, Patrisious
Haddad <phaddad@...dia.com>
Subject: Re: [PATCH iproute2-next 3/3] lib: utils: Add
parse_one_of_deprecated(), parse_on_off_deprecated()
On Wed, 15 Nov 2023 16:31:59 +0100
Petr Machata <petrm@...dia.com> wrote:
> The functions parse_on_off() and parse_one_of() currently use matches() for
> string comparison under the hood. This has some odd consequences. In
> particular, "o" can be used as a shorthand for "off", which is not obvious,
> because "o" is the prefix of both. By sheer luck, the end result actually
> makes some sense: "on" means on, anything else means off (or errors out).
> Similar issues are in principle also possible for parse_one_of() uses,
> though currently this does not come up.
This was probably a bug, I am open to breaking shorthand usage in this case.
Powered by blists - more mailing lists