Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1362388 - IPv4 vs IPv6 inconsistency on return value of ping
IPv4 vs IPv6 inconsistency on return value of ping
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iputils (Show other bugs)
7.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Jan Synacek
Robin Hack
: EasyFix, Patch
: 1387317 (view as bug list)
Depends On:
Blocks: 1380361
  Show dependency treegraph
 
Reported: 2016-08-02 02:13 EDT by Jianlin Shi
Modified: 2017-08-01 16:47 EDT (History)
6 users (show)

See Also:
Fixed In Version: iputils-20160308-9.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 16:47:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1987 normal SHIPPED_LIVE iputils bug fix update 2017-08-01 14:32:29 EDT

  None (edit)
Description Jianlin Shi 2016-08-02 02:13:14 EDT
Description of problem:
the return value of ping for ipv4 and ipv6 isn't the same

Version-Release number of selected component (if applicable):
ping utility, iputils-s20160308
3.10.0-481.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. add unreachable route for ipv4
2. ping unreachable dst
3. add unreachable route for ipv6
4. ping6 unreachable dst

Actual results:
return value in 2 is 2
return value in 4 is 1

Expected results:
the return value should be the same 2

Additional info:

[root@ibm-x3250m5-01 route_type]# uname -a
Linux ibm-x3250m5-01.rhts.eng.pek2.redhat.com 3.10.0-481.el7.x86_64 #1 SMP Wed Jul 27 18:24:27 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@ibm-x3250m5-01 route_type]# ping6 -V
ping utility, iputils-s20160308

[root@ibm-x3250m5-01 route_type]# ip route add unreachable 2000::/64

[root@ibm-x3250m5-01 route_type]# ping6 2000::1 -c 1
PING 2000::1(2000::1) 56 data bytes
ping: sendmsg: No route to host

--- 2000::1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

[root@ibm-x3250m5-01 route_type]# echo $?
1
<======1 here

[root@ibm-x3250m5-01 route_type]# ping 192.168.0.1 -c 1
connect: No route to host
[root@ibm-x3250m5-01 route_type]# echo $?
2
<========2 here

When use ping on rhel7.2GA whose version is iputils-s20121221,the return value is 2:

[root@dhcp-13-64 ~]# uname -a
Linux dhcp-13-64.nay.redhat.com 3.10.0-481.el7.x86_64 #1 SMP Wed Jul 27 18:24:27 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@dhcp-13-64 ~]# ping -V
ping utility, iputils-s20121221

[root@dhcp-13-64 ~]# ping6 2000::1 -c 1
connect: No route to host
[root@dhcp-13-64 ~]# echo $?
2
Comment 1 Jan Synacek 2016-08-02 04:32:23 EDT
https://github.com/iputils/iputils/issues/57
Comment 2 Jan Synacek 2016-08-03 08:02:52 EDT
I'm getting "connect: Network is unreachable" in both cases and the return value is 2. Please specify *exactly* how you set up the network in both cases.
Comment 3 Jaroslav Škarvada 2016-08-03 09:10:30 EDT
It seems to be caused by unification of the ping/ping6 code, i.e. the following upstream commit:
https://github.com/iputils/iputils/commit/ebad35fee3de851b809c7b72ccc654a72b6af61d

Before this commit it returned exit code 2 immediately, after this commit it returns exit code 1 after some timeout.
Comment 4 Jianlin Shi 2016-08-03 20:34:22 EDT
(In reply to Jan Synacek from comment #2)
> I'm getting "connect: Network is unreachable" in both cases and the return
> value is 2. Please specify *exactly* how you set up the network in both
> cases.

Hi Jan,

No special set up, just as the steps in the Description:

Boot up the system, then add unreachable route.

ip route add unreachable 2000::/64
ping6 2000::1 -c 1

Do you use the same iputils as mine:iputils-s20160308?
Comment 5 Jan Synacek 2016-08-04 03:28:33 EDT
I can reproduce this now... My machine was probably not set up properly.
Comment 6 Jan Synacek 2016-08-04 05:24:57 EDT
https://github.com/iputils/iputils/pull/58
Comment 7 Tomas Dolezal 2016-12-02 08:06:19 EST
duplicate bug 1387317
Comment 8 Jan Synacek 2016-12-07 08:27:20 EST
Likely. I will verify that.
Comment 9 Jan Synacek 2016-12-07 08:31:23 EST
Oops, sorry, wrong bug.
Comment 11 Jan Synacek 2017-02-21 06:23:23 EST
*** Bug 1387317 has been marked as a duplicate of this bug. ***
Comment 15 errata-xmlrpc 2017-08-01 16:47:16 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1987

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