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 D4D2F1FF13C for ; Thu, 19 Feb 2026 16:43:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 816571CDDF; Thu, 19 Feb 2026 16:44:42 +0100 (CET) Date: Thu, 19 Feb 2026 16:44:06 +0100 From: Gabriel Goller To: Hannes Laimer , pve-devel@lists.proxmox.com Subject: Re: [PATCH pve-network 04/10] sdn: write structured frr config that can be rendered using templates Message-ID: Mail-Followup-To: Hannes Laimer , pve-devel@lists.proxmox.com References: <20260203160246.353351-1-g.goller@proxmox.com> <20260203160246.353351-16-g.goller@proxmox.com> <7772d91e-b1e8-4e38-b720-c9f12ceca117@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1771515837476 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.003 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: OR46NMYROUMFLX2YKGIOUZV2NGJAVMQI X-Message-ID-Hash: OR46NMYROUMFLX2YKGIOUZV2NGJAVMQI X-MailFrom: g.goller@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 19.02.2026 16:36, Gabriel Goller wrote: > > [..] > > > > > > -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 > > Damn, these are some weird diffs?? Oh, turns out a hunk that changed this line is in a later change. Moved it back where it belongs :) > When the whole patch series is applied this is: > > my $routemaps = $frr_config->{'frr'}->{'routemaps'}; > > So I'll add a check if 'routemaps' exists, thanks! > > > > - 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; > > > + } > > > + } > > > } > > > [..]