diff options
author | Daniel Sommermann <[email protected]> | 2016-05-20 15:47:16 -0700 |
---|---|---|
committer | Daniel Sommermann <[email protected]> | 2016-05-20 15:58:41 -0700 |
commit | 5d7dcfc2e0de7e93b29d01f07a2f970720d62f9d (patch) | |
tree | a3ff59eac8c0745206f7ccde3c987148b6a72997 /lib/kernel/src/inet.erl | |
parent | 2098d573b097566d598ded1444625439ee6c0ae3 (diff) | |
download | otp-5d7dcfc2e0de7e93b29d01f07a2f970720d62f9d.tar.gz otp-5d7dcfc2e0de7e93b29d01f07a2f970720d62f9d.tar.bz2 otp-5d7dcfc2e0de7e93b29d01f07a2f970720d62f9d.zip |
Make inet:gethostbyname respect resolver option `inet6`
This makes the implementation text of inet:gethostbyname/1 identical to
that of inet_res:gethostbyname/1. I also copied over the doc note about
this resolver option.
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r-- | lib/kernel/src/inet.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index c1ae99ea24..713a9cf725 100644 --- a/lib/kernel/src/inet.erl +++ b/lib/kernel/src/inet.erl @@ -439,7 +439,12 @@ getstat(Socket,What) -> Hostent :: hostent(). gethostbyname(Name) -> - gethostbyname_tm(Name, inet, false). + case inet_db:res_option(inet6) of + true -> + gethostbyname_tm(Name, inet6, false); + false -> + gethostbyname_tm(Name, inet, false) + end. -spec gethostbyname(Hostname, Family) -> {ok, Hostent} | {error, posix()} when |