From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id CA31C1FF146 for ; Tue, 12 May 2026 15:43:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 60021148D4; Tue, 12 May 2026 15:43:50 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action Date: Tue, 12 May 2026 15:43:34 +0200 Message-ID: <20260512134336.312909-1-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778593310304 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.621 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: OTLLSBZQGVLDYPW24ZJCULFA6KGOHPEO X-Message-ID-Hash: OTLLSBZQGVLDYPW24ZJCULFA6KGOHPEO X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add missing format_description to the value properties in match and set property strings. Their exact format depends on the key set in the property string. The 2 keys that can have a value in the exit-action both refer to the order number of a route map entry, so change the type to the pre-defined route map order type. Order is a u16, so fix the maximum value to match the maximum accepted value by FRR. This is wrong in the JSON schema, but is correct in the section config type. Reported-by: Fiona Ebner Signed-off-by: Stefan Hanreich --- Not sure about the format description for match and set. Maybe we could do something like `||..` to indicate the exact format of value, depending on the key? src/PVE/Network/SDN/RouteMaps.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/PVE/Network/SDN/RouteMaps.pm b/src/PVE/Network/SDN/RouteMaps.pm index 5560f180..b2bf9eda 100644 --- a/src/PVE/Network/SDN/RouteMaps.pm +++ b/src/PVE/Network/SDN/RouteMaps.pm @@ -48,7 +48,8 @@ our $ROUTE_MAP_MATCH_FORMAT = { value => { type => 'string', optional => 1, - description => 'value that should be matched on', + description => 'Value that the field should be matched on.', + format_description => '', }, }; @@ -67,7 +68,7 @@ PVE::JSONSchema::register_standard_option( description => 'The index of this route map entry', type => 'integer', minimum => 0, - maximum => 2**32 - 1, + maximum => 65535, }, ); @@ -164,7 +165,8 @@ sub route_map_properties { value => { type => 'string', optional => 1, - description => 'value that should be set to', + description => 'Value that the field should be set to.', + format_description => '', }, }, }, @@ -187,11 +189,7 @@ sub route_map_properties { 'on-match-goto', 'on-match-next', 'continue', ], }, - value => { - type => 'string', - optional => 1, - description => 'type of exit action', - }, + value => get_standard_option('pve-sdn-route-map-order'), }, optional => 1, }, -- 2.47.3