HADOOP-12687. SecureUtil#QualifiedHostResolver#getByName should also try to resolve direct hostname (Sunil G via rohithsharmaks)

This commit is contained in:
rohithsharmaks 2016-01-07 10:42:48 +05:30
parent 791c1639ae
commit 2b252844e0
2 changed files with 10 additions and 0 deletions

View File

@ -660,6 +660,10 @@ Release 2.9.0 - UNRELEASED
BUG FIXES BUG FIXES
HADOOP-12687. SecureUtil#QualifiedHostResolver#getByName should also try to
resolve direct hostname, incase multiple loopback addresses are present in
/etc/hosts (Sunil G via rohithsharmaks)
Release 2.8.0 - UNRELEASED Release 2.8.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -580,8 +580,14 @@ public class SecurityUtil {
addr = getByNameWithSearch(host); addr = getByNameWithSearch(host);
if (addr == null) { if (addr == null) {
addr = getByExactName(host); addr = getByExactName(host);
// If multiple loopback addresses are present, a direct lookup
// will be helpful
if (addr == null) {
addr = InetAddress.getByName(host);
} }
} }
}
} }
// unresolvable! // unresolvable!
if (addr == null) { if (addr == null) {