inotify: interfaces: check if bridge_vids is truthy instead of defined

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.lauterer@proxmox.com>
This commit is contained in:
Aaron Lauterer 2024-10-02 15:11:52 +02:00 committed by Thomas Lamprecht
parent 34dec45c43
commit a8b8920d54

View File

@ -1311,7 +1311,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;