Bug 803880 - INET_rresolve() fails on 64bit, big-endian hosts
INET_rresolve() fails on 64bit, big-endian hosts
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-tools (Show other bugs)
6.2
ppc64 Linux
low Severity low
: rc
: ---
Assigned To: Michal Ruprich
Petr Sklenar
: FastFix, Patch
Depends On:
Blocks: 1373253
  Show dependency treegraph
 
Reported: 2012-03-15 15:42 EDT by Kevin W. Rudd
Modified: 2017-03-21 05:25 EDT (History)
1 user (show)

See Also:
Fixed In Version: net-tools-1.60-112.el6
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-03-21 05:25:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kevin W. Rudd 2012-03-15 15:42:35 EDT
net-tool utilities that use INET_rresolve() (like netstat) will
fail to resolve hostnames from the IP addresses on big-endian hosts
(e.g. ppc64, s390x).  The DNS query that is sent out ends up being:

PTR? 0.0.0.0.in-addr.arpa.

This is because "ad" and "host_ad" are being incorrectly set to "unsigned
long".  sin->sin_addr.s_addr and the return from ntohl() are uint32_t.
On 64bit, big-endian architectures, the gethostbyaddr() call is looking
at the upper 4 bytes (which are zero in this situation).

The following change resolves (pardon the pun) this issue: 

--- net-tools-1.60.orig/lib/inet.c      2012-03-15 12:16:04.403849459 -0700
+++ net-tools-1.60/lib/inet.c   2012-03-15 12:18:46.503205339 -0700
@@ -144,7 +144,7 @@
     struct hostent *ent;
     struct netent *np;
     struct addr *pn;
-    unsigned long ad, host_ad;
+    uint32_t ad, host_ad;
     int host = 0;
Comment 2 Jiri Popelka 2012-03-16 04:06:11 EDT
Thank you for the description and the patch !
Comment 4 RHEL Product and Program Management 2012-09-07 01:01:26 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 5 RHEL Product and Program Management 2013-10-13 20:45:45 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 14 errata-xmlrpc 2017-03-21 05:25:49 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://rhn.redhat.com/errata/RHBA-2017-0600.html

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