[PATCH common 1/1] fix #5623: ovs other_config set to 0 not saved in network config

Tiomet Pelston tiometpelston at gmail.com
Wed Oct 23 18:48:49 CEST 2024


When configuring an OVS network device via web interface,
any OVS option set to value=0 is ignored upon saving. This happens
because value=0 is evaluated as false in $parse_ovs_option.

Signed-off-by: Tiomet Pelston <tiometpelston at gmail.com>
---
 src/PVE/INotify.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 8a4a810..1b3babd 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -748,7 +748,7 @@ my $parse_ovs_option = sub {
     my $opts = {};
     foreach my $kv (split (/\s+/, $data || '')) {
 	my ($k, $v) = split('=', $kv, 2);
-	$opts->{$k} = $v if $k && $v;
+	$opts->{$k} = $v if $k && defined($v);
     }
     return $opts;
 };
-- 
2.43.0




More information about the pve-devel mailing list