From: Thomas Lamprecht Date: Sat, 9 May 2020 18:53:28 +0000 (+0200) Subject: network: bridge add IF: do not add all VLANs if $trunks are passed X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=0777906df25246936b21b764666427cc8149d04b network: bridge add IF: do not add all VLANs if $trunks are passed fixes commit 89ea13ef6b1555f92309da5c298e16579163eaf4 and restores old behavior, the "if !$trunks" post-if was a bit suble, it did not guard the die, but the system command previously - the die was || (ORd) to the command, bad code style to begin with.. Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index ac49536..04a964a 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -224,10 +224,9 @@ my $bridge_add_interface = sub { die "unable to add vlan $tag to interface $iface - $@\n" if $@; warn "Caution: Setting VLAN ID 1 on a VLAN aware bridge may be dangerous\n" if $tag == 1; - } else { + } elsif (!$trunks) { eval { run_command(['/sbin/bridge', 'vlan', 'add', 'dev', $iface, 'vid', '2-4094']) }; - die "unable to add default vlan tags to interface $iface - $@\n" - if $@ && !$trunks; + die "unable to add default vlan tags to interface $iface - $@\n" if $@; } if ($trunks) {