diff options
author | Raimo Niskanen <[email protected]> | 2016-05-25 14:38:46 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2016-05-25 14:38:46 +0200 |
commit | ca9ecbb1fb04a80bd849d866b750090975f501f3 (patch) | |
tree | 72b1bd800215fcc479f9ae24dc484a0ef0fdee8e /lib/kernel/src/inet.erl | |
parent | 7a03eab1dd3ce2a1f9b4f7eae09d62f1ea48f401 (diff) | |
parent | 5d7dcfc2e0de7e93b29d01f07a2f970720d62f9d (diff) | |
download | otp-ca9ecbb1fb04a80bd849d866b750090975f501f3.tar.gz otp-ca9ecbb1fb04a80bd849d866b750090975f501f3.tar.bz2 otp-ca9ecbb1fb04a80bd849d866b750090975f501f3.zip |
Merge branch 'dcsommer/kernel/inet-gethostbyname-res-option-inet6/PR-1065/OTP-13622'
* dcsommer/kernel/inet-gethostbyname-res-option-inet6/PR-1065/OTP-13622:
Make inet:gethostbyname respect resolver option `inet6`
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 |