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 /PVE/Network/SDN/Controllers/EvpnPlugin.pm | |
| 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>
Diffstat (limited to 'PVE/Network/SDN/Controllers/EvpnPlugin.pm')
| -rw-r--r-- | PVE/Network/SDN/Controllers/EvpnPlugin.pm | 6 |
1 files changed, 4 insertions, 2 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; |
