diff options
| author | Fabian Grünbichler <f.gruenbichler@proxmox.com> | 2020-07-01 09:57:32 +0200 |
|---|---|---|
| committer | Fabian Grünbichler <f.gruenbichler@proxmox.com> | 2020-07-01 09:57:34 +0200 |
| commit | 3caa7687f93302c43dfeca5d9efba29f3ac9c76b (patch) | |
| tree | c980f60cc98e75720830fd1bea70a574d33ffd61 | |
| parent | 5a60da84d97d79a66b48d8b0153030358684b5cd (diff) | |
split declaration and initialization with post-if
since combining them is undefined behaviour in perl and can cause
strange side-effects.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
| -rw-r--r-- | PVE/Network/SDN/Controllers/EvpnPlugin.pm | 6 | ||||
| -rw-r--r-- | PVE/Network/SDN/Zones/VxlanPlugin.pm | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 9321af1..d82de2a 100644 --- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -47,11 +47,13 @@ sub options { sub generate_controller_config { my ($class, $plugin_config, $controller, $id, $uplinks, $config) = @_; - my @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'}; + my @peers; + @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'}; my $asn = $plugin_config->{asn}; my $gatewaynodes = $plugin_config->{'gateway-nodes'}; - my @gatewaypeers = PVE::Tools::split_list($plugin_config->{'gateway-external-peers'}) if $plugin_config->{'gateway-external-peers'}; + my @gatewaypeers; + @gatewaypeers = PVE::Tools::split_list($plugin_config->{'gateway-external-peers'}) if $plugin_config->{'gateway-external-peers'}; return if !$asn; diff --git a/PVE/Network/SDN/Zones/VxlanPlugin.pm b/PVE/Network/SDN/Zones/VxlanPlugin.pm index 5f17e15..e8cf1bd 100644 --- a/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -50,7 +50,8 @@ sub generate_sdn_config { my $ipv6 = $vnet->{ipv6}; my $mac = $vnet->{mac}; my $multicastaddress = $plugin_config->{'multicast-address'}; - my @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'}; + my @peers; + @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'}; my $vxlan_iface = "vxlan_$vnetid"; die "missing vxlan tag" if !$tag; |
