From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 78C291FF164
	for <inbox@lore.proxmox.com>; Wed, 23 Oct 2024 18:48:27 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 731073190F;
	Wed, 23 Oct 2024 18:49:05 +0200 (CEST)
To: pve-devel@lists.proxmox.com
Date: Wed, 23 Oct 2024 18:48:49 +0200
In-Reply-To: <20241023164849.3027-1-tiometpelston@gmail.com>
References: <20241023164849.3027-1-tiometpelston@gmail.com>
MIME-Version: 1.0
Message-ID: <mailman.513.1729702144.332.pve-devel@lists.proxmox.com>
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Post: <mailto:pve-devel@lists.proxmox.com>
From: Tiomet Pelston via pve-devel <pve-devel@lists.proxmox.com>
Precedence: list
Cc: Tiomet Pelston <tiometpelston@gmail.com>
X-Mailman-Version: 2.1.29
X-BeenThere: pve-devel@lists.proxmox.com
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
Subject: [pve-devel] [PATCH common 1/1] fix #5623: ovs other_config set to 0
 not saved in network config
Content-Type: multipart/mixed; boundary="===============1444248961237468594=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============1444248961237468594==
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <tiometpelston@gmail.com>
X-Original-To: pve-devel@lists.proxmox.com
Delivered-To: pve-devel@lists.proxmox.com
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by lists.proxmox.com (Postfix) with ESMTPS id 7C8A2C7E5A
	for <pve-devel@lists.proxmox.com>; Wed, 23 Oct 2024 18:49:03 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 5D0F231873
	for <pve-devel@lists.proxmox.com>; Wed, 23 Oct 2024 18:49:03 +0200 (CEST)
Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by firstgate.proxmox.com (Proxmox) with ESMTPS
	for <pve-devel@lists.proxmox.com>; Wed, 23 Oct 2024 18:49:02 +0200 (CEST)
Received: by mail-wr1-x444.google.com with SMTP id ffacd0b85a97d-37d4fd00574so50792f8f.0
        for <pve-devel@lists.proxmox.com>; Wed, 23 Oct 2024 09:49:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1729702136; x=1730306936; darn=lists.proxmox.com;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=7ZHGEgCzEklPnU0zTNYJ5vtv2T89GQ8uhT8q8t5kZLE=;
        b=UwWsKyro+omCFnoT5JvNgEZ09otyLn7fmypm5VfHEe9etgzDlklQ8fLg0lhcBZehGv
         OxMbUI38N9xGAbn5uU6tWFzEAJ9EXbI8XRkF2Xf/A02ND+6pb/eE5wo5bvDNKoQbwruo
         ZW6dG9b9hJuvaLXYtPF+s+aFoRMKqENdmCnUVYtFF7LkI7DoqdRf+i+BSO95G4Btz0RZ
         wI5vRurXpyuGH30IAd43UssuGvRbX/7Bfi05KCUkQwPXwyAPlH/IggrcGLjtyjyiIeAp
         sbLUrwpxMaO4m01HGF4n4fIN6+OTp7jf3WId9rH3SVf3fYcriyVcROAEGUKv7yevRqij
         gbLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1729702136; x=1730306936;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=7ZHGEgCzEklPnU0zTNYJ5vtv2T89GQ8uhT8q8t5kZLE=;
        b=p1oo/dq5nl6hTZprzTJm+BuZVZDSGdxyR9RNWYEd0339E6GfcOAqccDOUhUKMiaZMT
         nJT5YNJ1pCDhKlVh11D4J6ZTN3Mtj8Es/x3qW7UygfapDur/5gLWTXDawiUYXF2wU6pM
         q6y0i+x8zl39T8twfI8zLXqIIHl2CT8nhR1WUu1mZT8FqkrfMoHdpOFt1BRsRssAiPFO
         As1MhaYmKbm0Ox/Ezh4Y+VfgTr+TFSZGu4VCa0vzOQIyQEidb00jdpXHgFwYvmriIbvR
         jouICguzEexdDblN2xtiUATjiZ5b/bzvyn4gcofMRtle2tIC5rhp3GUNZvAE7u71R7+O
         jrJw==
X-Gm-Message-State: AOJu0YwKadUTKo4+97mW3f9fXuitYhyeRKzjBwu94rLJxNxVyR7aakfC
	vubKSa1SOOrLt9Ne529Es4xI76J++Lhbu7MX7zUsp39dL/VgeohJ1cfSM/Bj
X-Google-Smtp-Source: AGHT+IHZLxUj+00ik1YmWLMx0Vj2DdAwo+16U9lXLpzaJpVfWAXRrPLCe8K8felsL6R2w27UluL+oQ==
X-Received: by 2002:a5d:4687:0:b0:374:c21a:9dd4 with SMTP id ffacd0b85a97d-37efc62c850mr2693346f8f.20.1729702136242;
        Wed, 23 Oct 2024 09:48:56 -0700 (PDT)
Received: from localhost.localdomain.misit-augsburg.de (vm210-misit.informatik.uni-augsburg.de. [137.250.168.210])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a37e1asm9308320f8f.20.2024.10.23.09.48.55
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 23 Oct 2024 09:48:56 -0700 (PDT)
From: Tiomet Pelston <tiometpelston@gmail.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH common 1/1] fix #5623: ovs other_config set to 0 not saved in network config
Date: Wed, 23 Oct 2024 18:48:49 +0200
Message-ID: <20241023164849.3027-2-tiometpelston@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20241023164849.3027-1-tiometpelston@gmail.com>
References: <20241023164849.3027-1-tiometpelston@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
	AWL                    -0.000 Adjusted score from AWL reputation of From: address
	BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
	DKIM_SIGNED               0.1 Message has a DKIM or DK signature, not necessarily valid
	DKIM_VALID               -0.1 Message has at least one valid DKIM or DK signature
	DKIM_VALID_AU            -0.1 Message has a valid DKIM or DK signature from author's domain
	DKIM_VALID_EF            -0.1 Message has a valid DKIM or DK signature from envelope-from domain
	DMARC_PASS               -0.1 DMARC pass policy
	FREEMAIL_FROM           0.001 Sender email is commonly abused enduser mail provider
	RCVD_IN_DNSWL_NONE     -0.0001 Sender listed at https://www.dnswl.org/, no trust
	SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
	SPF_PASS               -0.001 SPF: sender matches SPF record

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@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



--===============1444248961237468594==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

--===============1444248961237468594==--