From a2aae38c4b377ac55b51a4b56d7fd662946549d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 6 Nov 2019 13:36:37 +0100 Subject: [PATCH] use correct local IP address helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this always uses an explicit CIDR, so we don't need a round-trip via datacenter.cfg .. Signed-off-by: Fabian Grünbichler --- PVE/CLI/pvesm.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index ae1bc3d..161b0a3 100755 --- a/PVE/CLI/pvesm.pm +++ b/PVE/CLI/pvesm.pm @@ -309,7 +309,10 @@ __PACKAGE__->register_method ({ } elsif ($filename =~ m!^tcp://(([^/]+)(/\d+)?)$!) { my ($cidr, $ip, $subnet) = ($1, $2, $3); if ($subnet) { # got real CIDR notation, not just IP - $ip = PVE::Cluster::get_local_migration_ip($cidr); + my $ips = PVE::Network::get_local_ip_from_cidr($cidr); + die "Unable to get single local IP address in network '$cidr'\n" + if scalar(@$ips) != 1; + $ip = @$ips[0]; } my $family = PVE::Tools::get_host_address_family($ip); my $port = PVE::Tools::next_migrate_port($family, $ip);