From: Stephen Hemminger <stephen@networkplumber.org>
To: David Ahern <dsahern@gmail.com>
Cc: Norman Rasmussen <norman@rasmussen.co.za>, netdev@vger.kernel.org
Subject: Re: iproute2: ip address add prefer keyword confusion
Date: Fri, 28 May 2021 11:02:01 -0700 [thread overview]
Message-ID: <20210528110201.4e6a17b7@hermes.local> (raw)
In-Reply-To: <cee42fde-e171-6484-3091-fba1e65271df@gmail.com>
On Thu, 27 May 2021 22:31:24 -0600
David Ahern <dsahern@gmail.com> wrote:
> On 5/27/21 2:58 PM, Norman Rasmussen wrote:
> > commit 78d04c7b27cf ("ipaddress: Add support for address metric")
> > added "priority" and "preference" as aliases for the "metric" keyword,
> > but they are entirely undocumented.
> >
> > I only noticed because I was adding addresses with a preferred
> > lifetime, but I was using "pref" as the keyword. The metric code was
> > added _above_ the lifetime code, so after the change "pref" matches
> > "preference", instead of "preferred_lft".
> >
> > Is there an existing way to deal with conflicts between keyword
> > prefixes? Should "prefer" (or shorter) fail with a clear error
> > instead? Should the metric code have been added below the lifetime
> > code? Should it be moved or is it too late?
> >
>
> It is in general a known problem with iproute2's use of "matches" to
> allow shorthand commands.
>
> The change where "pref" goes to metric vs "preferred_lft" was
> unintentional. At this point (3 years after the commit) it would be hard
> to revert the change.
Agreed, matches() is a real bug trap.
prev parent reply other threads:[~2021-05-28 18:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 20:58 iproute2: ip address add prefer keyword confusion Norman Rasmussen
2021-05-28 4:31 ` David Ahern
2021-05-28 18:02 ` Stephen Hemminger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210528110201.4e6a17b7@hermes.local \
--to=stephen@networkplumber.org \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=norman@rasmussen.co.za \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.