]> git.proxmox.com Git - pve-common.git/commitdiff
network: bridge add IF: do not add all VLANs if $trunks are passed
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 9 May 2020 18:53:28 +0000 (20:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 9 May 2020 18:55:25 +0000 (20:55 +0200)
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 <t.lamprecht@proxmox.com>
src/PVE/Network.pm

index ac49536c27646602c0e60f239beb1dfecf567940..04a964a8c4c8e99d8ffb5add7c7d3402f39fbafe 100644 (file)
@@ -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) {