RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1362388 - IPv4 vs IPv6 inconsistency on return value of ping
Summary: IPv4 vs IPv6 inconsistency on return value of ping
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iputils
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Synacek
QA Contact: Robin Hack
URL:
Whiteboard:
: 1387317 (view as bug list)
Depends On:
Blocks: 1380361
TreeView+ depends on / blocked
 
Reported: 2016-08-02 06:13 UTC by Jianlin Shi
Modified: 2017-08-01 20:47 UTC (History)
6 users (show)

Fixed In Version: iputils-20160308-9.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 20:47:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1987 0 normal SHIPPED_LIVE iputils bug fix update 2017-08-01 18:32:29 UTC

Description Jianlin Shi 2016-08-02 06:13:14 UTC
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 08:32:23 UTC
https://github.com/iputils/iputils/issues/57

Comment 2 Jan Synacek 2016-08-03 12:02:52 UTC
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 13:10:30 UTC
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-04 00:34:22 UTC
(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 07:28:33 UTC
I can reproduce this now... My machine was probably not set up properly.

Comment 6 Jan Synacek 2016-08-04 09:24:57 UTC
https://github.com/iputils/iputils/pull/58

Comment 7 Tomas Dolezal 2016-12-02 13:06:19 UTC
duplicate bug 1387317

Comment 8 Jan Synacek 2016-12-07 13:27:20 UTC
Likely. I will verify that.

Comment 9 Jan Synacek 2016-12-07 13:31:23 UTC
Oops, sorry, wrong bug.

Comment 11 Jan Synacek 2017-02-21 11:23:23 UTC
*** Bug 1387317 has been marked as a duplicate of this bug. ***

Comment 15 errata-xmlrpc 2017-08-01 20:47:16 UTC
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.