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

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Nov 20 13:42:42 CET 2017


On 11/20/2017 12:51 PM, Fabian Grünbichler wrote:
> I think we can also get rid of all the other Net::IP::ip_is_ipv6 calls,
> and thus drop the dependency on Net::IP as well.. we only use it on
> corosync addresses in create and add.
> 

I wanted to get rid of AF_* here.
But yes for sure, changing them with PVE::Network helper which then use
Net::IP is an option, but as that can be done as a completely separate
and independent cleanup later on it would be nice to get this cleanup
still upstream, if you've already applied it locally, so I do not need
to resend this series exactly the same with just an additional patch :)

> On Thu, Nov 16, 2017 at 03:27:52PM +0100, Thomas Lamprecht wrote:
>> 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
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at pve.proxmox.com
>> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 






More information about the pve-devel mailing list