[pve-devel] [PATCH pve-storage 2/2] GlusterfsPlugin: replace Net::Ping with tcp_ping

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Aug 31 11:02:26 CEST 2015


Using PVE::Network::tcp_ping on port 7 (echo) for ipv6
support.
---
 PVE/Storage/GlusterfsPlugin.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/GlusterfsPlugin.pm b/PVE/Storage/GlusterfsPlugin.pm
index 7a8c82f..e59f1ee 100644
--- a/PVE/Storage/GlusterfsPlugin.pm
+++ b/PVE/Storage/GlusterfsPlugin.pm
@@ -5,9 +5,9 @@ use warnings;
 use IO::File;
 use File::Path;
 use PVE::Tools qw(run_command);
+use PVE::Network;
 use PVE::Storage::Plugin;
 use PVE::JSONSchema qw(get_standard_option);
-use Net::Ping;
 
 use base qw(PVE::Storage::Plugin);
 
@@ -39,8 +39,8 @@ my $get_active_server = sub {
 
 	if ($server && $server ne 'localhost' && $server ne '127.0.0.1' && $server ne '::1') {
 
-	    my $p = Net::Ping->new("tcp", 2);
-	    $status = $p->ping($server);
+	    # ping the echo port (7) without service check
+	    $status = PVE::Network::tcp_ping($server, undef, 2);
 
 	} else {
 
-- 
2.1.4





More information about the pve-devel mailing list