Subject: | PATCH: POE::Component::Client::Ping |
Date: | Mon, 10 Mar 2008 13:14:23 -0700 (PDT) |
To: | bug-POE-Component-Client-Ping [...] rt.cpan.org |
From: | Andrew Feren <acferen [...] yahoo.com> |
Message body is not shown because sender requested not to inline it.
Attached is a simple patch applied against $VERSION = '1.13';
Now for the long story...
I was experiencing intermittent problems with poco::Ping (very consistently for a large enough numbers of pinged hosts). I did not get as far as pinning down the exact problem. Rather I saw some code that was taking the last 'N' bytes off of each ICMP datagram and treating that as data. The value of 'N' was determined by what was expect rather than what was in the packet. I fixed those couple of lines to skip over the IP header and read the expected number of bytes out.
With this change the error I was seeing went away.
That was good enough for the moment so I stopped looking. I suspect that some packets may have been shorter than expected and as a result we were getting arbitrary data in our buffer.
-Andrew
FWIW here is the error I was getting.
The error I was getting was:
Use of uninitialized value in subroutine entry at /PerlApp/POE/Component/Client/Ping.pm line 409.
Can't use string ("") as a subroutine ref while "strict refs" in use at /PerlApp/POE/Component/Client/Ping.pm line 409.
-Andrew Feren
acferen@yahoo.com