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 190B81FF140 for ; Fri, 27 Mar 2026 11:06:02 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5AB2B2BBC; Fri, 27 Mar 2026 11:06:25 +0100 (CET) Date: Fri, 27 Mar 2026 11:05:51 +0100 From: Gabriel Goller To: Thomas Lamprecht Subject: Re: [PATCH proxmox-ve-rs v7 08/21] frr: add bgp support with templates and serialization Message-ID: Mail-Followup-To: Thomas Lamprecht , pve-devel@lists.proxmox.com References: <20260323134934.243110-1-g.goller@proxmox.com> <20260323134934.243110-9-g.goller@proxmox.com> <06cc8c1f-03e3-4e6f-8bbc-69874ea6c953@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <06cc8c1f-03e3-4e6f-8bbc-69874ea6c953@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774605901633 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.023 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: SC26YZ2YTS6UQ3KKADGGEGWYVGQCLYZT X-Message-ID-Hash: SC26YZ2YTS6UQ3KKADGGEGWYVGQCLYZT 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 CC: pve-devel@lists.proxmox.com 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 27.03.2026 01:50, Thomas Lamprecht wrote: > Am 23.03.26 um 14:50 schrieb Gabriel Goller: > > +++ b/proxmox-frr-templates/templates/bgpd.jinja > > +{% for ip_route in vrf.ip_routes %} > > +{% if ip_route.vrf %} > > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route ... > > +{% else %} > > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route ... > > +{% endfor %} > > +{% endif %} > > the endfor and endif statements are swapped here - the for-loop is closed > while the if-block is still open. This is a Jinja nesting error that should > fail at template parse time, at least that's what I'd expect. > > Ah, it's fixed in 09/21 but should be squashed into this patch. Ah, I blame `jj absorb` :) > > +++ b/proxmox-frr/src/ser/bgp.rs > > +pub struct NeighborGroup { > > + pub ebgp_multihop: Option, > > eBGP multihop can't be negative (FRR accepts 1-255), so probably should be > an Option? Agree, fixed. > > +pub struct L2vpnEvpnAF { > > + pub autort_as: Option, > > Similar here, ASNs are unsigned, so Option. Fixed as well. > > +pub struct NeighborGroup { > > + pub local_as: Option, > > This field exists but bgp_router.jinja never renders `neighbor X local-as > Y`. If intentionally unsupported for now, either just drop it or add some > (TODO) comment providing rationale. Yep, this will (most likely) be added with the bgp fabrics. Removed it for now though. > > +++ b/proxmox-frr-templates/templates/frr.conf.jinja > > +{% include "bgpd.jinja" %} > > {% include "isisd.jinja" %} > > +{% include "prefix_lists.jinja" %} > > {% for line in custom_frr_config %} > > {{ line }} > > {% endfor %} > > {% include "fabricd.jinja" %} > > {% include "ospfd.jinja" %} > > {% include "access_lists.jinja" %} > > {% include "route_maps.jinja" %} > > +{% include "ip_routes.jinja" %} > > {% include "protocol_routemaps.jinja" %} > > Nit: prefix_lists ends up "separated" from the includes of access_lists and > route_maps by custom_frr_config + fabricd + ospfd. Since route-maps > reference prefix/access lists, grouping all filter objects together would be > more conventional and might be maybe slightly friendlier to frr-reload.py's > incremental processing. This would be nice, but we can't do this since this would break backwards-compat. This is the order (circa) in which the perl-code currently generates and we need to preserve this because otherwise stuff becomes overrideable by the frr.conf.local suddenly.