Bug 79360 - Net::Ping succeeds regardless of port assignment
Net::Ping succeeds regardless of port assignment
Product: Fedora
Classification: Fedora
Component: perl (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2002-12-10 13:29 EST by Vince Broz
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-19 18:19:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test script (310 bytes, text/plain)
2002-12-10 13:30 EST, Vince Broz
no flags Details

  None (edit)
Description Vince Broz 2002-12-10 13:29:30 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020826

Description of problem:
Net::Ping succeeds regardless of port assignment

The Net::Ping library, on Red Hat Linux 8.0, seems to ignore the port specified
and only checks whether a given host is active or not.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run the attached script, modifying it to point to a port that is listening on
2. Run the attached script, modifying it to point to a port that is NOT
listening on localhost.

Actual Results:  On Red Hat Linux 8.0:

1. Script printed "Able to connect..."
2. Script printed "Able to connect..."

Expected Results:  Observed on Red Hat Linux 7.3:

1. Script prints "Able to connect..."
2. Script prints "Unable to connect..."

Additional info:
Comment 1 Vince Broz 2002-12-10 13:31:00 EST
Created attachment 88250 [details]
Test script
Comment 2 Warren Togami 2005-05-28 03:28:49 EDT
Can someone test the script provided in this report and verify if this is still
an issue?
Comment 3 Ville Skyttä 2005-06-01 13:53:17 EDT
Yep, it's an issue on FC3 (perl-5.8.5-12.FC3) and FC4 (perl-5.8.6-15).  I could
reproduce the failure on a Solaris and a Debian box too, so it looks like an
upstream issue.  See also http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Ping

On a side note, the issue (all tcp pings succeed even for non-open ports) seems
to occur here only when pinging a local IP address, others appear to work as
expected.  But that could be a coincidence.
Comment 4 Jason Vas Dias 2006-01-19 18:19:00 EST
I'm not sure this is actually a bug.

As the Net::Ping manual states:

   $p->service_check( { 0 | 1 } );
        Set whether or not the connect behavior should enforce remote service 
        availability as well as reachability.  Normally, if the remote server 
        reported ECONNREFUSED, it must have been reachable because of the 
        status packet that it reported.  With this option enabled, the full   
        three-way tcp handshake must have been established successfully before
        it will claim it is reachable.

So adding 
before the 
in the example script attachment makes it only succeed if a tcp server
is actually listening to the $port on $host, which I believe was the 
intent, and which resolves the problem described in this bug.

Yes, I agree if a port is specified for a TCP ping, a full connect(2) attempt
should be made, but this is not how Net::Ping was designed or documented to
work - a tcp ping only verifies that the host is reachable, unless the 
service_check(1) option is specified .

Hence, this bug is being closed as NOTABUG - if you disagree, please re-open it.

Note You need to log in before you can comment on or make changes to this bug.