Bug 803880 - INET_rresolve() fails on 64bit, big-endian hosts
Summary: INET_rresolve() fails on 64bit, big-endian hosts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-tools
Version: 6.2
Hardware: ppc64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Michal Ruprich
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On:
Blocks: 1373253
TreeView+ depends on / blocked
 
Reported: 2012-03-15 19:42 UTC by Kevin W. Rudd
Modified: 2017-03-21 09:25 UTC (History)
1 user (show)

Fixed In Version: net-tools-1.60-112.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 09:25:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0600 0 normal SHIPPED_LIVE net-tools bug fix update 2017-03-21 12:26:13 UTC

Description Kevin W. Rudd 2012-03-15 19:42:35 UTC
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 08:06:11 UTC
Thank you for the description and the patch !

Comment 4 RHEL Program Management 2012-09-07 05:01:26 UTC
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 Program Management 2013-10-14 00:45:45 UTC
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 09:25:49 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-2017-0600.html


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