[pve-devel] [PATCH cluster v2 2/3] pvecm: module cleanup: use our get_host_address_family

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 16 15:27:52 CET 2017


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 data/PVE/CLI/pvecm.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index 015978d..6b1ab65 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -3,7 +3,6 @@ package PVE::CLI::pvecm;
 use strict;
 use warnings;
 use Getopt::Long;
-use Socket;
 use IO::File;
 use IO::Socket::IP;
 use POSIX;
@@ -853,7 +852,7 @@ __PACKAGE__->register_method ({
 	    if (defined($network)) {
 		$ip = PVE::Cluster::get_local_migration_ip($network)
 		    or die "failed to get migration IP address to listen on\n";
-		$family = Net::IP::ip_is_ipv6($ip) ? AF_INET6 : AF_INET;
+		$family = PVE::Tools::get_host_address_family($ip);
 	    } else {
 		my $nodename = PVE::INotify::nodename();
 		($ip, $family) = PVE::Network::get_ip_from_hostname($nodename, 0);
-- 
2.11.0





More information about the pve-devel mailing list