Commits

Anonymous committed 3f9130b

Fix the inet_ntop / inet_pton warnings.

Comments (0)

Files changed (2)

modules/IO-Socket-INET6/ChangeLog

+	* Fix the inet_pton / inet_ntop import warnings:
+		- https://rt.cpan.org/Ticket/Display.html?id=55901
+		- Thanks to Todd Rinaldo for the patch.
+
 2010-03-19 Shlomi Fish <shlomif@iglu.org.il>
 	* Syntax change to adapt for older Perls:
 		- https://rt.cpan.org/Ticket/Display.html?id=54656

modules/IO-Socket-INET6/lib/IO/Socket/INET6.pm

 # IO::Socket and Socket already import stuff here - possibly AF_INET6
 # and PF_INET6 so selectively import things from Socket6.
 use Socket6 (
-    qw(AI_PASSIVE inet_ntop inet_pton getaddrinfo 
+    qw(AI_PASSIVE getaddrinfo
     sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all in6addr_any)
 );
 
   my @serv = ();
 
   if (defined $addr) {
-	if (!inet_pton(AF_INET6,$addr)) {
+	if (!Socket6::inet_pton(AF_INET6,$addr)) {
          if($addr =~ s,^\[([\da-fA-F:]+)\]:([\w\(\)/]+)$,$1,) {
    	     $port = $2;
          } elsif($addr =~ s,^\[(::[\da-fA-F.:]+)\]:([\w\(\)/]+)$,$1,) {
     @_ == 1 or croak 'usage: $sock->sockhost()';
     my ($sock) = @_;
     return undef unless (my $addr = $sock->sockaddr);
-    inet_ntop($sock->sockdomain, $addr);
+    Socket6::inet_ntop($sock->sockdomain, $addr);
 }
 
 sub sockflow
     @_ == 1 or croak 'usage: $sock->peerhost()';
     my ($sock) = @_;
     return undef unless (my $addr = $sock->peeraddr);
-    inet_ntop($sock->sockdomain, $addr);
+    Socket6::inet_ntop($sock->sockdomain, $addr);
 }
 
 sub peerflow
    $sock = IO::Socket::INET6->new('[::1]:25');
 
    $sock = IO::Socket::INET6->new(PeerPort  => 9999,
-                                 PeerAddr  => inet_ntop(AF_INET6,in6addr_broadcast),
+                                 PeerAddr  => Socket6::inet_ntop(AF_INET6,in6addr_broadcast),
                                  Proto     => udp,    
                                  LocalAddr => 'localhost',
                                  Broadcast => 1 )