this always uses an explicit CIDR, so we don't need a round-trip via
datacenter.cfg ..
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
} 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);