Netdev List
 help / color / mirror / Atom feed
From: Justin Iurman <justin.iurman@gmail.com>
To: Hangbin Liu <hangbin.liu@linux.dev>,
	netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH iproute2-next] lwt: ioam6: allow options in any order
Date: Sat, 24 Oct 2026 17:26:28 +0200	[thread overview]
Message-ID: <1d0887eb-2ce1-4768-a1ee-6c05a0830f52@gmail.com> (raw)
In-Reply-To: <20261022-ioam_fix_order-v1-1-6eac1e00455b@kylinos.cn>

On 10/22/26 04:53, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> The ioam6 encap options must be given in a fixed order (freq, mode,
> tunsrc, tundst, trace, prealloc, type, ns, size). If a user uses a
> different order, the command fails with a misleading error even
> though every option is present:
> 
>    # ip -6 route change 2001:db8:2:1::/64 encap ioam6 mode encap \
>        trace prealloc tundst 2001:db8:2:1::2 type 0x800000 ns 0 size 12 \
>        via 2001:db8:1::3 dev dummy0
>    Error: argument "tundst" is required
> 
> Parse all options in a single while loop instead, then run the
> cross-option and missing-argument checks after the loop, reporting
> the missing arguments in the order the options are documented in
> ip-route(8).

The current order is not arbitrary by intent:

1. freq
2. mode
3. tunsrc
4. tundst
5. trace
6. prealloc
7. type|ns|size

While I agree some could be swappable and the above order is too strict, 
most are dependent on context (i.e., a previous keyword). For example, 
(type|ns|size) are only valid in a 'prealloc' context, which one is only 
valid in a 'trace' context. They form a group and their current order 
should remain inside this group.

OTOH, as mentioned, some could be swapped. For example, both tunsrc and 
tundst could come in whatever order. However, they are only valid in a 
specific 'mode' context, so they should appear after it. With 'mode', 
they form another group. 'freq' forms another group by itself.

So, I guess a new accepted (relaxed) order should accept groups in 
whatever order, but the order inside a same group should remain. That 
said, I'd be open to this proposal if other iproute2 commands also 
accept parameters in any order, regardless of their scope or dependencies.

Justin

  reply	other threads:[~2026-10-24 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  2:53 [PATCH iproute2-next] lwt: ioam6: allow options in any order Hangbin Liu
2026-10-24 15:26 ` Justin Iurman [this message]
2026-10-26  1:46   ` Hangbin Liu

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=1d0887eb-2ce1-4768-a1ee-6c05a0830f52@gmail.com \
    --to=justin.iurman@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=hangbin.liu@linux.dev \
    --cc=liuhangbin@kylinos.cn \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox