From 0777906df25246936b21b764666427cc8149d04b Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 9 May 2020 20:53:28 +0200 Subject: [PATCH] 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 --- src/PVE/Network.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) { -- 2.39.2