network: fix uninitialized value error

This commit is contained in:
Wolfgang Bumiller 2016-01-18 09:17:23 +01:00 committed by Dietmar Maurer
parent 8992139368
commit 846337ad41

View 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";
}
}
}
};