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 875811FF17E for ; Thu, 2 Oct 2025 14:47:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EA16BEFC6; Thu, 2 Oct 2025 14:47:31 +0200 (CEST) Date: Thu, 2 Oct 2025 14:47:28 +0200 From: Gabriel Goller To: Stefan Hanreich Message-ID: Mail-Followup-To: Stefan Hanreich , Proxmox VE development discussion References: <20250919132438.167861-1-g.goller@proxmox.com> <40a85883-b25c-4042-b842-10f013836efc@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <40a85883-b25c-4042-b842-10f013836efc@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759409225448 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [frr.pm] Subject: Re: [pve-devel] [PATCH network] sdn: write frr config if the frr.conf.local file exists X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 01.10.2025 12:06, Stefan Hanreich wrote: >Tested this on my machine, works as advertised. The general idea of >regenerating the FRR config anytime we reload SDN also makes sense to >me, since it allows users to have a FRR config and potentially create >controllers / fabrics at a later time and not have to worry about their >frr.conf getting overwritten accidentally. > >Reviewed-by: Stefan Hanreich >Tested-by: Stefan Hanreich > >On 9/19/25 3:25 PM, Gabriel Goller wrote: >> [snip] >> diff --git a/src/PVE/Network/SDN/Frr.pm b/src/PVE/Network/SDN/Frr.pm >> index b607b32c248d..e77eba182177 100644 >> --- a/src/PVE/Network/SDN/Frr.pm >> +++ b/src/PVE/Network/SDN/Frr.pm >> @@ -32,6 +32,22 @@ string that is a FRR configuration line. >> use PVE::RESTEnvironment qw(log_warn); >> use PVE::Tools qw(file_get_contents file_set_contents run_command); >> >> +my $FRR_CONF_LOCAL_FILE = "/etc/frr/frr.conf.local"; >> + >> +=head3 local_frr_config_exists >> + >> +Returns true if the `/etc/frr/frr.conf.local` file exists, otherwise false. >> + >> +=cut >> + >> +sub local_frr_config_exists { >> + if (-e $FRR_CONF_LOCAL_FILE) { >> + return 1; >> + } else { >> + return 0; >> + } >> +} >> + >> =head3 read_local_frr_config >> >> Returns the contents of `/etc/frr/frr.conf.local` as a string if it exists, otherwise undef. >> @@ -39,8 +55,8 @@ Returns the contents of `/etc/frr/frr.conf.local` as a string if it exists, othe >> =cut >> >> sub read_local_frr_config { >> - if (-e "/etc/frr/frr.conf.local") { >> - return file_get_contents("/etc/frr/frr.conf.local"); >> + if (-e $FRR_CONF_LOCAL_FILE) { > >small nit: potentially use the helper here, if we define one anyway? good point, will send a v2 soon! >+ return file_get_contents($FRR_CONF_LOCAL_FILE); >> } >> } Thanks for the review! _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel