Skip Menu |

This queue is for tickets about the Net-Ping CPAN distribution.

Report information
The Basics
Id: 80479
Status: resolved
Priority: 0/
Queue: Net-Ping

People
Owner: SMPETERS [...] cpan.org
Requestors: VINSWORLD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.36
Fixed in: (no value)



Subject: IPv6 Support - with patch!
There is currently no IPv6 support in Net::Ping relying on IPv4 only routines like sockaddr_in and inet_ntoa/aton. I've created a patch to support IPv6. It's 95% complete. I'm having issues calculating the ICMPv6 checksum. As you may know, the ICMPv6 checksum is different than ICMPv4 in that ICMPv6 uses a pseudo-header (much like TCP/UDP) for checksum calculation. How to find the source address if the user does not call bind() before actually sending the packet? Other than that, IPv4 remains the default and all tests result in the same output for me as they did before the patch. IPv6 ping now also works, only not with ICMPv6 as transport (due to aforementioned checksum issue). I'd like some help getting that last ICMPv6 checksum part resolved and get this IPv6 support added to Net::Ping. cheers.
Subject: Ping.patch

Message body is not shown because it is too large.

From: tlhackque [...] yahoo.com
Whether or not the suggested patch is the right approach, IPv6 support for this core module would be appreciated. IPv6 adoption is increasing, and this is a hole in Perl's support.
From: tlhackque [...] yahoo.com
With respect to the questions about the patch: A quick search turns up the source for ping6 at http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ping6/ping6.c? rev=1.81&content-type=text/x-cvsweb-markup&only_with_tag=MAIN Checksum: The header checksum field is initialized to zero, but not computed - I assume (but haven't dug in) that sendmsg computes. Source address: When no explicit interface is bound, the source address is determined by indirectly consulting the routing tables - a UDP socket is connect() ed and getsockname() called. Look for the code under if (!(options & F_SRCADDR)) Hope this helps.
I will be looking at this patch soon. I have applied some other lower priority changes to Net::Ping for the 2.40 release that will make this change difficult to apply. In addition, I will be working on the new() for Net::Ping. With the addition of IPv6 support, there will be seven optional parameters to new, which is just silly and screams reworking. Most of the code, however, should be able to be applied as is. The 2.40 release should be out within the next month. This may be able to be included as well, or it will be in the next release after that so about two months out.
Subject: Re: [rt.cpan.org #80479] IPv6 Support - with patch!
Date: Thu, 14 Mar 2013 12:23:27 -0400
To: bug-Net-Ping [...] rt.cpan.org
From: Vince <vin [...] vinsworld.com>
Named arguments to new() may be a good idea. I tried to work within the original structure of the module for the IPv6 inclusion, but if you're looking to rework the structure, there are certainly better ways to include IPv6 support than what I coded in the patch. Let me know if there is anything I can do to help keeping in mind I'm not the most talented Perl hacker. cheers. On Thu, Mar 14, 2013 at 12:17 PM, Steve Peters via RT <bug-Net-Ping@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80479 > > > I will be looking at this patch soon. I have applied some other lower > priority changes to Net::Ping for the 2.40 release that will make this > change difficult to apply. In addition, I will be working on the new() > for Net::Ping. With the addition of IPv6 support, there will be seven > optional parameters to new, which is just silly and screams reworking. > Most of the code, however, should be able to be applied as is. The 2.40 > release should be out within the next month. This may be able to be > included as well, or it will be in the next release after that so about > two months out.
From: tlhackque [...] yahoo.com
On Thu Mar 14 12:17:23 2013, SMPETERS wrote: Show quoted text
> I will be looking at this patch soon. I have applied some other lower > priority changes to Net::Ping for the 2.40 release that will make this > change difficult to apply. In addition, I will be working on the new() > for Net::Ping. With the addition of IPv6 support, there will be seven > optional parameters to new, which is just silly and screams reworking. > Most of the code, however, should be able to be applied as is. The 2.40 > release should be out within the next month. This may be able to be > included as well, or it will be in the next release after that so about > two months out.
Er, 'ping'? I know we're all volunteers/busy, but IPv6 continues to grow, and it has been almost a year since you guestimated a couple of months...
Subject: Re: [rt.cpan.org #80479] IPv6 Support - with patch!
Date: Mon, 3 Feb 2014 19:25:30 -0500
To: bug-Net-Ping [...] rt.cpan.org
From: Vince <vin [...] vinsworld.com>
You realize SMPETERS wrote the update you're referring to. I posted the original feature request for IPv6 with a proof of concept patch. I don't own or maintain the module. Cheers. On Feb 3, 2014 6:59 PM, "via RT" <bug-Net-Ping@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80479 > > > On Thu Mar 14 12:17:23 2013, SMPETERS wrote:
> > I will be looking at this patch soon. I have applied some other lower > > priority changes to Net::Ping for the 2.40 release that will make this > > change difficult to apply. In addition, I will be working on the new() > > for Net::Ping. With the addition of IPv6 support, there will be seven > > optional parameters to new, which is just silly and screams reworking. > > Most of the code, however, should be able to be applied as is. The 2.40 > > release should be out within the next month. This may be able to be > > included as well, or it will be in the next release after that so about > > two months out.
> > Er, 'ping'? I know we're all volunteers/busy, but IPv6 continues to grow, > and it has been almost a year since you guestimated a couple of months... > > >
Subject: Re: [rt.cpan.org #80479] IPv6 Support - with patch!
Date: Mon, 3 Feb 2014 21:35:41 -0700
To: bug-Net-Ping [...] rt.cpan.org
From: Rob Brown <bbb [...] cpan.org>
I don't think the patch has been incorporated yet. On Mon, Feb 3, 2014 at 5:25 PM, vinsworldcom via RT < bug-Net-Ping@rt.cpan.org> wrote: Show quoted text
> Queue: Net-Ping > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80479 > > > You realize SMPETERS wrote the update you're referring to. I posted the > original feature request for IPv6 with a proof of concept patch. I don't > own or maintain the module. > > Cheers. > On Feb 3, 2014 6:59 PM, "via RT" <bug-Net-Ping@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=80479 > > > > > On Thu Mar 14 12:17:23 2013, SMPETERS wrote:
> > > I will be looking at this patch soon. I have applied some other lower > > > priority changes to Net::Ping for the 2.40 release that will make this > > > change difficult to apply. In addition, I will be working on the new() > > > for Net::Ping. With the addition of IPv6 support, there will be seven > > > optional parameters to new, which is just silly and screams reworking. > > > Most of the code, however, should be able to be applied as is. The
> 2.40
> > > release should be out within the next month. This may be able to be > > > included as well, or it will be in the next release after that so about > > > two months out.
> > > > Er, 'ping'? I know we're all volunteers/busy, but IPv6 continues to
> grow,
> > and it has been almost a year since you guestimated a couple of months... > > > > > >
> >
RT-Send-CC: vin [...] vinsworld.com, bbb [...] cpan.org, tlhackque [...] yahoo.com
Added and fixed the patch at https://github.com/smpeters/net-ping/pull/5 Merged with p5p changes and Steve Peters latest test changes, to be compatible with p5p and cperl. Added also the new native icmpv6 protocol. untested.
CC: vin [...] vinsworld.com, tlhackque [...] yahoo.com, Rob Brown <bbb [...] cpan.org>
Subject: Re: [rt.cpan.org #80479] IPv6 Support - with patch!
Date: Sat, 16 Apr 2016 07:26:32 -0600
To: bug-Net-Ping [...] rt.cpan.org
From: Rob Brown <bbb [...] cpan.org>
I'm seeing a bunch of conflicts in the git repos so I'm not sure the best way to solve it. Reini, since I know you from our cPanel conferences, I know you can be trusted with co-maint on this module, so I went ahead and approved it as you requested: "Added RURBAN to co-maintainers of Net::Ping." Can you help merge everything cleanly? Remember that this is considered a core module for many version of perl, so try to make sure the p5porters are okay with it. But I think it's probably okay if you PAUSE a new version up. Thanks for your help! -- Rob On Sat, Apr 16, 2016 at 4:29 AM, Reini Urban via RT < bug-Net-Ping@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80479 > > > Added and fixed the patch at https://github.com/smpeters/net-ping/pull/5 > > Merged with p5p changes and Steve Peters latest test changes, to be > compatible > with p5p and cperl. > > Added also the new native icmpv6 protocol. untested. > >
Subject: [rt.cpan.org #80479] Patch for ICMPv6 support for Net::Ping 2.61
Date: Sun, 6 Aug 2017 22:32:33 +0200
To: bug-Net-Ping [...] rt.cpan.org
From: Nikolas Garofil <nikolas [...] garofil.be>
In the newest Net::Ping (v2.61) the ping-sub doesn't work with ICMPv6. Proof of concept code below. When you run this code with Net::Ping v2.61 (and probably also all older versions) you will see it fail twice. After patching the code with my patch (in attachment) you will see that pinging the 1st IP works and the 2nd fails (like it should). #!/usr/bin/perl use Net::Ping; $rightip="2001:4860:4860::8888"; #pingable ip of google's dnsserver $wrongip="2001:4860:4860::1234"; #non existing ip $p=Net::Ping->new("icmpv6",undef,undef,undef,undef,undef,"ipv6"); print "Pinging $rightip "; if($p->ping($rightip)) { print "works.\n"; } else { print "fails.\n"; } print "Pinging $wrongip "; if($p->ping($wrongip)) { print "works.\n"; } else { print "fails.\n"; } Feel free to rewrite the patch in another style (or improve if it causes problems for you). Nikolas

Message body is not shown because sender requested not to inline it.

RT-Send-CC: nikolas [...] garofil.be
On Sun Aug 06 16:32:52 2017, nikolas@garofil.be wrote: Show quoted text
> In the newest Net::Ping (v2.61) the ping-sub doesn't work with ICMPv6. > > Proof of concept code below. > When you run this code with Net::Ping v2.61 (and probably also all older > versions) you will see it fail twice. > After patching the code with my patch (in attachment) you will see that > pinging the 1st IP works and the 2nd fails (like it should).
Salut Nikolas, Can be please check the ping_icmpv6 branch, with your patch. I don't think you can just ignore the ICMPv6_ECHOREPLY type with IMCPv6, and ICMPv6_NI_REPLY is also missing. Anyway, I'm firewalled for ipv6 and get timeouts. -- Reini Urban
Done with 2.66 I had no testcase for the ICMPv6_ECHOREPLY from_type yet, so this might fail. There's also no ICMPv6_NI_REPLY support, as in ping6. Normal icmpv6 pings resolved locally to ICMP_ECHOREPLY.