The old check for defined would also be true if it contained an empty
string. By checking its truthyness, an empty string will be falsy and
therefore the default value will be used.

Signed-off-by: Aaron Lauterer <a.laute...@proxmox.com>
---
changes since:
v4: newly added

 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..d29e2a1 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1315,7 +1315,7 @@ sub __interface_to_string {
 
        if (defined($d->{bridge_vlan_aware})) {
            $raw .= "\tbridge-vlan-aware yes\n";
-           my $vlans = defined($d->{bridge_vids}) ? $d->{bridge_vids} : 
"2-4094";
+           my $vlans = $d->{bridge_vids} ? $d->{bridge_vids} : "2-4094";
            $raw .= "\tbridge-vids $vlans\n";
        }
        $done->{bridge_vlan_aware} = 1;
-- 
2.39.5



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

Reply via email to