Bug 40323

Summary: ping gives incorrect return value
Product: [Retired] Red Hat Linux Reporter: Need Real Name <jgolds>
Component: iputilsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-23 11:47:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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