Thread (3 messages) flat view 3 messages, 3 authors, 2021-05-28

Re: iproute2: ip address add prefer keyword confusion

From: David Ahern <hidden>
Date: 2021-05-28 04:36:14

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help