]> git.proxmox.com Git - pve-common.git/commitdiff
network: fix uninitialized value error
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 18 Jan 2016 08:17:23 +0000 (09:17 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 18 Jan 2016 10:01:35 +0000 (11:01 +0100)
src/PVE/Network.pm

index 293ebfa0b2666e25166e933c0a95139c088c9586..8cfac0dbe1db369860a660b97d4ede2d76ddafaf 100644 (file)
@@ -177,10 +177,12 @@ my $bridge_add_interface = sub {
            die "unable to add default vlan tags to interface $iface\n" if !$trunks;
        } 
 
-        my @trunks_array = split /;/, $trunks;
-       foreach my $trunk (@trunks_array) { 
-           system("/sbin/bridge vlan add dev $iface vid $trunk") == 0 ||
-           die "unable to add vlan $trunk to interface $iface\n";
+       if ($trunks) {
+           my @trunks_array = split /;/, $trunks;
+           foreach my $trunk (@trunks_array) { 
+               system("/sbin/bridge vlan add dev $iface vid $trunk") == 0 ||
+               die "unable to add vlan $trunk to interface $iface\n";
+           }
        }
    }
 };