Bug 40323 - ping gives incorrect return value
Summary: ping gives incorrect return value
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: iputils   
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
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:
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: ---


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.