From 846337ad41443605e4e9c7a7bf9039bbfcdeb05f Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 18 Jan 2016 09:17:23 +0100 Subject: [PATCH] network: fix uninitialized value error --- src/PVE/Network.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 293ebfa..8cfac0d 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -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"; + } } } }; -- 2.39.2