From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 05BF41FF13C for ; Thu, 19 Feb 2026 14:51:55 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C5DBE16052; Thu, 19 Feb 2026 14:52:54 +0100 (CET) Message-ID: <7772d91e-b1e8-4e38-b720-c9f12ceca117@proxmox.com> Date: Thu, 19 Feb 2026 14:52:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-network 04/10] sdn: write structured frr config that can be rendered using templates To: Gabriel Goller , pve-devel@lists.proxmox.com References: <20260203160246.353351-1-g.goller@proxmox.com> <20260203160246.353351-16-g.goller@proxmox.com> Content-Language: en-US From: Hannes Laimer In-Reply-To: <20260203160246.353351-16-g.goller@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1771509158106 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.060 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: BWXXEJAHCGFFWYWOCANVBZECQWD4WCGR X-Message-ID-Hash: BWXXEJAHCGFFWYWOCANVBZECQWD4WCGR X-MailFrom: h.laimer@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: On 2026-02-03 17:04, Gabriel Goller wrote: > The structured frr config can be deserialized by rust and rendered using > the templates (isis and bgp) in proxmox-frr. > > Co-authored-by: Stefan Hanreich > Signed-off-by: Gabriel Goller > --- > src/PVE/Network/SDN.pm | 11 +- > src/PVE/Network/SDN/Controllers/BgpPlugin.pm | 104 ++--- > src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 372 +++++++++--------- > src/PVE/Network/SDN/Controllers/IsisPlugin.pm | 28 +- > src/PVE/Network/SDN/Fabrics.pm | 14 +- > src/PVE/Network/SDN/Frr.pm | 163 +------- > 6 files changed, 276 insertions(+), 416 deletions(-) > [..] > > -Converts a given C<\%frr_config> to the raw config format. > +Iterates over all bgp route-maps in C<\$frr_config> and renumbers their sequence > +numbers to be consecutive, starting from 1 and incrementing by 1 for each entry. > > =cut > > -sub to_raw_config { > +sub fix_routemap_seqs { > my ($frr_config) = @_; > > - my $raw_config = []; > + my $routemaps = $frr_config->{'frr'}->{'bgp'}->{'routemaps'}; we should check if `routemaps`(and probably also `bgp`) exists, either here, or where we call this in `generate_frr_raw_config`. but here is probably better > - generate_frr_vrf($raw_config, $frr_config->{frr}->{vrf}); > - generate_frr_interfaces($raw_config, $frr_config->{frr_interfaces}); > - generate_frr_recurse($raw_config, $frr_config->{frr}, undef, 0); > - generate_frr_list($raw_config, $frr_config->{frr_access_list}, "access-list"); > - generate_frr_list($raw_config, $frr_config->{frr_prefix_list}, "ip prefix-list"); > - generate_frr_list($raw_config, $frr_config->{frr_prefix_list_v6}, "ipv6 prefix-list"); > - generate_frr_simple_list($raw_config, $frr_config->{frr_bgp_community_list}); > - generate_frr_routemap($raw_config, $frr_config->{frr_routemap}); > - generate_frr_simple_list($raw_config, $frr_config->{frr_ip_protocol}); > - > - return $raw_config; > + foreach my $id (sort keys %$routemaps) { > + my $routemap = $routemaps->{$id}; > + my $order = 0; > + foreach my $seq (@$routemap) { > + $order++; > + $seq->{seq} = $order; > + } > + } > } > > =head3 raw_config_to_string(\@raw_config) > @@ -339,139 +337,4 @@ sub append_local_config { > } > } > [..] > 1;