| Summary: | INET_rresolve() fails on 64bit, big-endian hosts | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Kevin W. Rudd <solgato> |
| Component: | net-tools | Assignee: | Michal Ruprich <mruprich> |
| Status: | CLOSED ERRATA | QA Contact: | Petr Sklenar <psklenar> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.2 | CC: | psklenar |
| Target Milestone: | rc | Keywords: | FastFix, Patch |
| Target Release: | --- | ||
| Hardware: | ppc64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| 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 09:25:49 UTC | Type: | --- |
| 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: | 1373253 | ||
Thank you for the description and the patch ! 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. 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. 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 |
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;