🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7296

Re: [PATCH iproute2-next] lwt: ioam6: allow options in any order

#7296
From: Hangbin Liu
Date: Mon, 26 Oct 2026 01:46
60 lines
10787 bytes
Hi Justin,
On Sat, Oct 24, 2026 at 05:26:28PM +0200, Justin Iurman wrote:
> 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.

Thanks for the reply. I agree your explanation about the ordering makes sense.
Personally, though, I still think the ordering constraint is too strict. And
the new patch also validates for mode mismatches and missing parameters.

I’ve checked all encap types: only mpls and ila require the address to be the
first parameter, seg6 has an error info about the tunsrc order. All others allow
arbitrary order.

I’m fine with keeping the existing behavior, as I can read the source code and
know the order is fixed. But new users will likely hit this same issue again.

Thanks
Hangbin
Technical Details
Message-ID: <at6xE1zwuKqeO8yv@fedora>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351661-linux-kernel-netdev=dewy.ru
References: <20261022-ioam_fix_order-v1-1-6eac1e00455b@kylinos.cn> <1d0887eb-2ce1-4768-a1ee-6c05a0830f52@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351661-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH iproute2-next] lwt: ioam6: allow options in any order
Date: Mon, 26 Oct 2026 09:46:59 +0800
Organization: Usenet Network
Message-ID: <at6xE1zwuKqeO8yv@fedora>
References: <20261022-ioam_fix_order-v1-1-6eac1e00455b@kylinos.cn>
 <1d0887eb-2ce1-4768-a1ee-6c05a0830f52@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1194817"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uRE0+j2AnWpKjlGKUFF1CljRrnE= sha256:+e+Iimh8dGGwyNA/nlcwk7JkevrZW9Mz9jsnUtJyzlE=
	sha1:rR6JaRhKUcdXEZqd7F+TdlkKRlg= sha256:d8PONAkJoVxxHuvJrT4EhoJXkgScsfEKiis0WY3fokY=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7E3B3125B88; Mon, 26 Oct 2026 04:47:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9lEug_lnuY47;
	Mon, 26 Oct 2026 04:47:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-351661-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 780EC125B85; Mon, 26 Oct 2026 04:47:19 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id DE85C601745; Mon, 26 Oct 2026 01:47:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792979233;
	b=Vl5n59A/rbR/0ve0YNKiqcoALpGtLK98718sfhEvJbmSshy9UB9HWMlrz03FJCeNkPzK
	 J4BAiR8FeYf6x18PqTSiE55Rbz7pfBRHc68btPqX0OYAvE8OmpNu/LNd3yTAL0CrfbimP
	 2iIUQ/MGlTiB3d0rX5Il5Y5I/Nd3yOLZjNZqk0As3VKNSxiSb6ov+YKiTlBHPi6o0Pz/w
	 rVdkm86934bCTzPrKLHXFSKGbC3UDR1NZgEbAMPquESxply0mDr+MA7RfAxEkD6fSlR1w
	 R/ZWGt4Yk9E8gn7EMsG39sRJStZ0QzjJHHxvDouUInC9NkQhr8TE/t4pnGxaSsptK7A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792979233;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=vr8X29dQrrQJKmK5OdQoBdcR8wKwrCCJ4tUvXjR0kCU=;
	b=4vDSxxY3tS3F9SK0EOmtqF4o4nk3uqUoKYydMerzx09BUJ2udFW7d8iTX/nguyI3GYdN
	 9tufcQypEhWnuzFybEgos8S+oFvZj4SVoCnegOHy4BGPcXq8ikKLb4RN5lv8qt5P0MCm/
	 NaYrCYoD5JF788sOdK1yOF7nPd2F82bBJ+I+ey93nZQS7HlxtvJhZ/oegowMeqr4lBfYm
	 s0i75Wx4+zFhiA9vz6Tjg8/z7do7hfKAAyUI4kPqLf9P5VNc9AGkJCPCWzYQJYLc+VTwB
	 LTMuCXScahyhQwuZ9ETBmQrrlccArAaEY+2NmOQ1aGzCEwlCmc+BflGBFkJexnnHv2A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eaFqB4uV;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FDAE606A31D;
	Mon, 26 Oct 2026 01:47:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eaFqB4uV
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.146
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792979231;
	b=qCeoReABIh0O+lAyVhs6aCmRXA5q5h+UKVf9y5ChbybJLaLzhQ6hBkfgXGae1ClGXgNC
	 jnYtnsW44sOR/Kvq0zta5qah7SIEL22MIUVjGDhyd1nERatrsERkI1M8/fZdzySMIhLmZ
	 uvyIWeXRWYn3GuDjyxMdLx7obyCvx9zV78bkDIiY49R+SDFTkdHRLk5klHp5RMwP3u3Wa
	 yNgcO12E5i0LJKWnscKIgsgAu658/s5tZoJeJV07a1VUw8Yp4YdWEnaxjOfgfrZUdAgmw
	 i3OOKD854hOH/wLFc17MW/S7uwujZhrZmDxl+MfIS5Hs//YBNsUdF6lVSW9E2XP2bfw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792979231;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=vr8X29dQrrQJKmK5OdQoBdcR8wKwrCCJ4tUvXjR0kCU=;
	b=bA+rH0hNdTJbDPZEhlSrmTYfWVeQRGgBbfiNR8D+i7yWZBSfsNxnDSLsH+vh78QCRgBG
	 1o8N4Ku+UaL/LZOLgbt28FVGcPS/sTbS5RNrIEkLZmuFz6su83IkuBnVQlOR3idxH/xju
	 8oe9L22VSUFm43qbJcc0iyNPhqgVGhxhbEwtkyPAGs2GDeQOhEsamfut2mctFMDrRjDkX
	 rWh6H7AyfsU+qoKzaGUBqTmagDkUDM26DeRQwqbu5IZu8x27nU3M7amDJtuZhLQ9B9/JT
	 OCK1EqvPsnJUeLuUVvYOEYuhg2HoktK7DtKkmuver9vdQA6IAmveA1MDNSqNt5EQN/w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eaFqB4uV;
	arc=none smtp.remote-ip=91.218.175.146
X-Received: from mta0.migadu.com (out-146.mta0.migadu.com [91.218.175.146])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48BDC606A31B
	for <netdev@vger.kernel.org>; Mon, 26 Oct 2026 01:47:09 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48BDC606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=nzYtk9ThRxKUkgTRTXSdCFqFhEwm/Eizg/eT16xq+V0=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1792979228; v=1; x=1793584028;
 b=eaFqB4uVTtEesZwscubNwEiLHXvdm/3BjaZga40Pb3ThZbD+krDzIX+owscspXJIgn/4lirW
 1vQwRvZvxTpSGH90evMtP1ePJF8sENgOIoh6Ey4EJDs5zji57A5sNE6IW2GEt7O/XjFHqfP6NkO
 z/Ho4lA0ij1xVbR5aQTv+Zlg=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta11.migadu.com with ESMTPS id 5699498c42138b6c;
	Mon, 26 Oct 2026 01:47:08 +0000
X-Mizu-Trace-ID: 5699498c42138b6c
X-Migadu-Flow: FLOW_OUT
X-Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Hangbin Liu <liuhangbin@kylinos.cn>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <1d0887eb-2ce1-4768-a1ee-6c05a0830f52@gmail.com>