Bug 40323 - ping gives incorrect return value
ping gives incorrect return value
Product: Red Hat Linux
Classification: Retired
Component: iputils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-05-11 17:47 EDT by Need Real Name
Modified: 2015-03-04 20:09 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-23 07:47:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-05-11 17:47:55 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.4.4 i686)

Description of problem:
When using ping with the -w option, ping gives an incorrect return value if
no packets are received.

How reproducible:

Steps to Reproduce:
1. run ping with -w option: i.e. ping <target> -w 1

Actual Results:  If no packets are received, ping will return a value of 0.

Expected Results:  Ping should return a value of 1 when no packets are

Additional info:

Looking at the ping source code from iputils-20000418-6, the line:
        exit(deadline ? (nreceived<npackets) : nreceived==0);

should be
        exit(deadline ? (nreceived<npackets) || (nreceived == 0) :

Bug is reproducible with iputils-20001110-1 as well.
Comment 1 Phil Knirsch 2001-05-23 07:46:58 EDT
OK, checked, will fix for next update.

Read ya, Phil
Comment 2 Phil Knirsch 2001-06-26 08:55:19 EDT
Fixed in rawhide.

Read ya, Phil

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