in reply to Net::Ping just don't werk
Really, there are two problems - why host is unreachable and why "Bad arg length" error appears.
You could read the discussion of both the problems here. Solution is in Msg5.
For impatient:
Host is unreachable because Net::Ping being used with UDP or TCP checks it via echo service (port 7). This service is down by default on some linux and BSD (one man said me that it is due to security reason). Solution: use ICMP (and run as root) or switch on echo service on remote host.
"Bad arg length" error appears if remote host is unreachable (may be it is the result of the first problem). Simple patch to Net::Ping - while waiting package you should check return value of recv and do nothing if it is false.
Patch for Net::Ping 2.02 - change line 373
$from_saddr = recv($self->{"fh"}, $from_msg, 1500, $flags);to
$from_saddr = recv($self->{"fh"}, $from_msg, 1500, $flags) or last;and you will have remote host unreachable instead of the error.
Could anybody tell me - where and how should I officially submit this patch?
-- brother ab
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Net::Ping just don't werk
by little (Curate) on Nov 02, 2000 at 14:01 UTC |