Bug 1113082

Summary: ping returns odd results with options inet6 in resolv.conf
Product: Red Hat Enterprise Linux 6 Reporter: Ronald van Zantvoort <van.zantvoort>
Component: iputilsAssignee: Jan Synacek <jsynacek>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5CC: psklenar, rhack, van.zantvoort
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iputils-20071127-20.el6 Doc Type: Bug Fix
Doc Text:
Cause: When domain name translation was forced to be done over IPv6, the output of the "ping" command was not correct, as it displayed an incorrect IP address that it got from the internal library, because a wrong call was used. Consequence: IP addresses were not correctly translated from domain names. The wrong values were then displayed in the output. Fix: Underlying logic was modified to use gethostbyname2() instead of gethostbyname(). Result: Domain name to IP address translation now works correctly and the output is then correct.
Story Points: ---
Clone Of:
: 1210331 (view as bug list) Environment:
Last Closed: 2015-07-22 05:49:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1210331    

Description Ronald van Zantvoort 2014-06-25 12:11:04 UTC
Description of problem:
Identical to F20 bug #1096415, ping doesn't bother to specifically ask for an IPv4 address nor does it check whether it received one.
With 'options inet6' ping will ask for 'an address' rather than 'an IPv4 address' and will receive an IPv6 one.
Therefore, the IPv6 address is parsed away as an IPv4 address and that get's pinged.
The issue is resolved in later versions of iputils.

Version-Release number of selected component (if applicable):
iputils-20071127

How reproducible:
1. Add 'options inet6' to /etc/resolv.conf
2. Ping a host with at least one AAAA record

Actual results:
strange IP address is being pinged.

Expected results:
The correct IP address should be pinged.

Additional info:
Working/Expected situation:
/etc/resolv.conf:
nameserver 8.8.8.8

sys# dig +short -t A www.pcextreme.nl
pcextreme.nl.
109.72.87.211

sys# ping www.pcextreme.nl
PING pcextreme.nl (109.72.87.211) 56(84) bytes of data.
(...)

Broken situation:
/etc/resolv.conf:
options inet6
nameserver 8.8.8.8

sys# dig +short -t A www.pcextreme.nl
pcextreme.nl.
109.72.87.211

sys# ping www.pcextreme.nl
PING pcextreme.nl (42.0.15.16) 56(84) bytes of data.
(...)

Comment 6 errata-xmlrpc 2015-07-22 05:49:54 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://rhn.redhat.com/errata/RHBA-2015-1251.html