]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Network.pm
network: bridge add IF: do not add all VLANs if $trunks are passed
[pve-common.git] / 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) {