[pve-devel] [PATCH 1/4] Use IO::Socket::IP instead of INET

Wolfgang Bumiller w.bumiller at proxmox.com
Fri May 8 12:24:41 CEST 2015


---
 src/PVE/Daemon.pm |  6 +++---
 src/PVE/Tools.pm  | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/PVE/Daemon.pm b/src/PVE/Daemon.pm
index 264f8be..0d0e16b 100644
--- a/src/PVE/Daemon.pm
+++ b/src/PVE/Daemon.pm
@@ -24,7 +24,7 @@ use PVE::INotify;
 use POSIX ":sys_wait_h";
 use Fcntl ':flock';
 use Socket qw(IPPROTO_TCP TCP_NODELAY SOMAXCONN);
-use IO::Socket::INET;
+use IO::Socket::IP;
 
 use Getopt::Long;
 use Time::HiRes qw (gettimeofday);
@@ -795,13 +795,13 @@ sub create_reusable_socket {
 	    if $sockfd !~ m/^(\d+)$/;
 	$sockfd = $1; # untaint
 
-	$socket = IO::Socket::INET->new;
+	$socket = IO::Socket::IP->new;
 	$socket->fdopen($sockfd, 'w') || 
 	    die "cannot fdopen file descriptor '$sockfd' - $!\n";
 
     } else {
 
-	$socket = IO::Socket::INET->new(
+	$socket = IO::Socket::IP->new(
 	    LocalAddr => $host,
 	    LocalPort => $port,
 	    Listen => SOMAXCONN,
diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 827ca58..d886a3d 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -3,7 +3,7 @@ package PVE::Tools;
 use strict;
 use warnings;
 use POSIX qw(EINTR);
-use IO::Socket::INET;
+use IO::Socket::IP;
 use IO::Select;
 use File::Basename;
 use File::Path qw(make_path);
@@ -691,11 +691,11 @@ sub next_unused_port {
 	for (my $p = $range_start; $p < $range_end; $p++) {
 	    next if $ports->{$p}; # reserved
 
-	    my $sock = IO::Socket::INET->new(Listen => 5,
-					     LocalAddr => '0.0.0.0',
-					     LocalPort => $p,
-					     ReuseAddr => 1,
-					     Proto     => 0);
+	    my $sock = IO::Socket::IP->new(Listen => 5,
+					   LocalAddr => '0.0.0.0',
+					   LocalPort => $p,
+					   ReuseAddr => 1,
+					   Proto     => 0);
 
 	    if ($sock) {
 		close($sock);
-- 
2.1.4





More information about the pve-devel mailing list