mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
Merge pull request #26366 from yuwata/nss-myhostname
nss-myhostname: two fixlets
This commit is contained in:
commit
dad1305eca
@ -346,9 +346,10 @@ enum nss_status _nss_myhostname_gethostbyname3_r(
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
}
|
||||
|
||||
if (af == AF_INET6 && !socket_ipv6_is_enabled())
|
||||
goto not_found;
|
||||
|
||||
if (is_localhost(name)) {
|
||||
if (af == AF_INET6 && !socket_ipv6_is_enabled())
|
||||
goto not_found;
|
||||
|
||||
canonical = "localhost";
|
||||
local_address_ipv4 = htobe32(INADDR_LOOPBACK);
|
||||
@ -461,7 +462,7 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r(
|
||||
} else {
|
||||
assert(af == AF_INET6);
|
||||
|
||||
if (socket_ipv6_is_enabled())
|
||||
if (!socket_ipv6_is_enabled())
|
||||
goto not_found;
|
||||
|
||||
if (memcmp(addr, LOCALADDRESS_IPV6, 16) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user