summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Hanreich <s.hanreich@proxmox.com>2025-02-07 14:40:37 +0100
committerThomas Lamprecht <t.lamprecht@proxmox.com>2025-02-11 21:24:28 +0100
commitbd7c331536ed3aa9ba53b94a9440f4c18b724c26 (patch)
tree204a087ee3a9fafc2fe6151d1b7008d9f71ba349 /src
parent39fb956fb8f20e7d6e162548db24ac1fb3df31a4 (diff)
sdn: fix comparison of pending configuration values
The conditional assignment caused falsy values to be converted to undef when comparing them. This led to the behavior that configuration values that are interpreted by perl as falsy would get wrongly compared and always show up as pending changes. As an example the 'bgp-multipath-as-path-relax' or 'ebgp' keys of the bgp controller configuration are booleans and get stored as 0 in the controller configuration when they're turned off. They always showed up as a pending change, because of the behavior described above. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Diffstat (limited to 'src')
-rw-r--r--src/PVE/Network/SDN.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm
index c7dccfa..4ac9720 100644
--- a/src/PVE/Network/SDN.pm
+++ b/src/PVE/Network/SDN.pm
@@ -115,8 +115,8 @@ sub pending_config {
my $config_object = $config_objects->{$id};
foreach my $key (sort keys %{$config_object}) {
- my $config_value = PVE::Network::SDN::encode_value(undef, $key, $config_object->{$key}) if $config_object->{$key};
- my $running_value = PVE::Network::SDN::encode_value(undef, $key, $running_object->{$key}) if $running_object->{$key};
+ my $config_value = PVE::Network::SDN::encode_value(undef, $key, $config_object->{$key});
+ my $running_value = PVE::Network::SDN::encode_value(undef, $key, $running_object->{$key});
if($key eq 'type' || $key eq 'vnet') {
$pending->{$id}->{$key} = $config_value;
} else {