[pve-devel] [PATCH pve-network 17/17] frr: fix reloading frr configuration

Gabriel Goller g.goller at proxmox.com
Fri Mar 28 18:13:32 CET 2025


From: Stefan Hanreich <s.hanreich at proxmox.com>

Reloading the FRR configuration failed, because outfunc was defined as
an empty hash, but Tools.pm requires it to be a CODE reference, so the
following error has been thrown on FRR reload:

  Not a CODE reference at /usr/share/perl5/PVE/Tools.pm line 577.

Fix this by not providing an outfunc at all (it was empty anyway) and
for future debugging / error reporting actually include the error in
the task log.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
 src/PVE/Network/SDN/Frr.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Network/SDN/Frr.pm b/src/PVE/Network/SDN/Frr.pm
index 7922e27cbfc0..d38a4180ff96 100644
--- a/src/PVE/Network/SDN/Frr.pm
+++ b/src/PVE/Network/SDN/Frr.pm
@@ -68,10 +68,10 @@ sub reload {
 
     if (-e $conf_file && -e $bin_path) {
 	eval {
-	    run_command([$bin_path, '--stdout', '--reload', $conf_file], outfunc => {}, errfunc => $err);
+	    run_command([$bin_path, '--stdout', '--reload', $conf_file], errfunc => $err);
 	};
 	if ($@) {
-	    warn "frr reload command fail. Restarting frr.";
+	    warn "frr reload command fail: $@ Restarting frr.";
 	    eval { run_command(['systemctl', 'restart', 'frr']); };
 	}
     }
-- 
2.39.5





More information about the pve-devel mailing list