New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Net::Ping IPv6 support - with patch #12621
Comments
From vinsworldcom@gmail.comCreated by vinsworldcom@gmail.comThere is currently no IPv6 support in Net::Ping relying on IPv4 only As you may know, the ICMPv6 checksum is different than ICMPv4 in that Other than that, IPv4 remains the default and all tests result in the I'd like some help getting that last ICMPv6 checksum part resolved and The original bug was submitted via CPAN at: https://rt.cpan.org/Public/Bug/Display.html?id=80479 and the patch is included with that bug report and follows: ____START: PATCH____ Inline Patch--- Ping.pm Mon Jun 08 12:30:57 2009
+++ Ping.pm Mon Oct 29 16:05:42 2012
@@ -5,18 +5,23 @@
use strict;
use vars qw(@ISA @EXPORT $VERSION
- $def_timeout $def_proto $def_factor
+ $def_timeout $def_proto $def_factor $def_family
$max_datasize $pingstring $hires $source_verify $syn_forking);
use Fcntl qw( F_GETFL F_SETFL O_NONBLOCK );
-use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW PF_INET SOL_SOCKET SO_ERROR
- inet_aton inet_ntoa sockaddr_in );
+use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW AF_INET IPPROTO_TCP
+my $AF_INET6 = eval { Socket::AF_INET6() }; sub SOL_IP { 0; }; $self->{"tos"} = $tos; + if ($family) { # Description: Set the local IP address from which pings will be sent. - $ip = inet_aton($local_addr); - if ($self->{"proto"} eq "udp" || $self->{"proto"} eq "icmp") - croak("Usage: \$p->ping(\$host [, \$timeout])") unless @_ == 2 || @_ == 3; - $ip = inet_aton($host); # Dispatch to the appropriate routine. - return wantarray ? ($ret, &time() - $ping_time, inet_ntoa($ip)) : $ret; # Uses Net::Ping::External to do an external ping. eval { require Net::Ping::External; } -use constant ICMP_ECHOREPLY => 0; # ICMP packet types + socket($self->{"fh"}, $ip->{"family"}, SOCK_RAW, $self->{"proto_num"}) || # Description: Do a checksum on the message. Basically sum all of - $saddr = sockaddr_in($self->{"port_num"}, $ip); my $ret = 0; # Default to unreachable my $do_socket = sub { # Unset O_NONBLOCK property on filehandle @@ -838,7 +886,7 @@ croak "tried to switch servers while stream pinging" return $self->tcp_echo($timeout, $pingstring); + if ($family) { if($self->{"proto"} eq "stream") { - $saddr = sockaddr_in($self->{"port_num"}, $ip); + socket($self->{"fh"}, $ip->{"family"}, SOCK_DGRAM, my $fh = FileHandle->new(); # Create TCP socket if (defined $self->{"local_addr"} && @@ -1089,15 +1170,15 @@ # Create TCP socket if (defined $self->{"local_addr"} && @@ -1247,7 +1328,7 @@ @@ -1327,7 +1408,7 @@ +######################################################## 1; =over 4 -=item Net::Ping->new([$proto [, $def_timeout [, $bytes [, $device [, Create a new ping object. All of the parameters are optional. $proto If $tos is given, this ToS is configured into the socket. -=item $p->ping($host [, $timeout]); Ping the remote host and wait for a response. $host can be either the =item $p->source_verify( { 0 | 1 } ); Perl Info
|
From @jkeenanOn Tue Nov 27 12:16:24 2012, VinsWorldcom wrote:
Steve Peters: Your posting at Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From vinsworldcom@gmail.comJim, I'm not Steve Peters - I submitted the original request for IPv6 support Does v2.41 include IPv6 support - as that was my initial "feature request"? cheers. On Sun, May 26, 2013 at 7:56 PM, James E Keenan via RT <
|
From @rjbs* Vince <vinsworldcom@gmail.com> [2013-05-28T06:46:59]
If it does, the changelog says nothing about it. That said, [rt.cpan.org #80479] exists and is open. I'm not sure a bug against -- |
From @rjbsI'm marking this as a blocker… for 5.21.1. We can get this patched early in the 5.21 series and once we know it's good, make a CPAN release. I'd rather not make this change so soon before 5.20. I apologize for the delay. -- |
From @tonycozOn Wed Feb 26 16:06:01 2014, rjbs wrote:
Net::Ping has changed extensively enough since that patch was produced it doesn't come close to applying anymore. Tony |
As per the original CPAN ticket referred to when the complaint was raised, looks like Net::Ping now has IPv6 support: https://rt.cpan.org/Public/Bug/Display.html?id=80479 Perhaps this ticket can be closed? |
The Perl 5 core distribution now has Net::Ping version 2.71. So I think it would be good to put this issue out of its misery and request that any new problems be reported in new issues or to the upstream maintainer. Thank you very much. |
Migrated from rt.perl.org#115932 (status was 'open')
Searchable as RT115932$
The text was updated successfully, but these errors were encountered: