]> git.proxmox.com Git - pve-storage.git/commitdiff
use correct local IP address helper
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 6 Nov 2019 12:36:37 +0000 (13:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 8 Nov 2019 10:24:52 +0000 (11:24 +0100)
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>
PVE/CLI/pvesm.pm

index ae1bc3de3082b4c7b63ef43f81b33c25915e2f1b..161b0a343e7e62b6c126a939b76c20dce854bc62 100755 (executable)
@@ -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);