Bug 40323 - ping gives incorrect return value
Summary: ping gives incorrect return value
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: iputils
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-11 21:47 UTC by Need Real Name
Modified: 2015-03-05 01:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-05-23 11:47:03 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2001-05-11 21:47:55 UTC
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:
Always

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
received.

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) :
nreceived==0);

Bug is reproducible with iputils-20001110-1 as well.

Comment 1 Phil Knirsch 2001-05-23 11:46:58 UTC
OK, checked, will fix for next update.

Read ya, Phil

Comment 2 Phil Knirsch 2001-06-26 12:55:19 UTC
Fixed in rawhide.

Read ya, Phil


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