diff options
author | Raimo Niskanen <[email protected]> | 2018-03-06 14:57:08 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2018-03-06 14:57:08 +0100 |
commit | f59026a57ccdfe4e462cbab9b97e9cd377dd5bdb (patch) | |
tree | bcb8c3e1f96b995797a0c5282117f35f8f9d09e4 /lib/kernel/src/inet_res.erl | |
parent | f529c3a4d5add57c2d65114781d1f3c4f96d2a7c (diff) | |
parent | 6a4fb088b97a118bd1dcc1a544578f9fabc10c25 (diff) | |
download | otp-f59026a57ccdfe4e462cbab9b97e9cd377dd5bdb.tar.gz otp-f59026a57ccdfe4e462cbab9b97e9cd377dd5bdb.tar.bz2 otp-f59026a57ccdfe4e462cbab9b97e9cd377dd5bdb.zip |
Merge branch 'raimo/stop-encouraging-v4-mapped/ERL-503/OTP-13716'
* raimo/stop-encouraging-v4-mapped/ERL-503/OTP-13716:
Stop translating V4MAPPED addresses
Stop returning V4MAPPED addresses
Implement function for IPv4-mapped IPv6 addresses
Diffstat (limited to 'lib/kernel/src/inet_res.erl')
-rw-r--r-- | lib/kernel/src/inet_res.erl | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/lib/kernel/src/inet_res.erl b/lib/kernel/src/inet_res.erl index 49aa5f8bda..6454802b04 100644 --- a/lib/kernel/src/inet_res.erl +++ b/lib/kernel/src/inet_res.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2016. All Rights Reserved. +%% Copyright Ericsson AB 1997-2018. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -349,9 +349,6 @@ gethostbyaddr_tm({A,B,C,D} = IP, Timer) when ?ip(A,B,C,D) -> {ok, HEnt} -> {ok, HEnt}; _ -> res_gethostbyaddr(dn_in_addr_arpa(A,B,C,D), IP, Timer) end; -%% ipv4 only ipv6 address -gethostbyaddr_tm({0,0,0,0,0,16#ffff,G,H},Timer) when is_integer(G+H) -> - gethostbyaddr_tm({G div 256, G rem 256, H div 256, H rem 256},Timer); gethostbyaddr_tm({A,B,C,D,E,F,G,H} = IP, Timer) when ?ip6(A,B,C,D,E,F,G,H) -> inet_db:res_update_conf(), case inet_db:gethostbyaddr(IP) of @@ -431,28 +428,7 @@ gethostbyname(Name,Family,Timeout) -> gethostbyname_tm(Name,inet,Timer) -> getbyname_tm(Name,?S_A,Timer); gethostbyname_tm(Name,inet6,Timer) -> - case getbyname_tm(Name,?S_AAAA,Timer) of - {ok,HEnt} -> {ok,HEnt}; - {error,nxdomain} -> - case getbyname_tm(Name, ?S_A,Timer) of - {ok, HEnt} -> - %% rewrite to a ipv4 only ipv6 address - {ok, - HEnt#hostent { - h_addrtype = inet6, - h_length = 16, - h_addr_list = - lists:map( - fun({A,B,C,D}) -> - {0,0,0,0,0,16#ffff,A*256+B,C*256+D} - end, HEnt#hostent.h_addr_list) - }}; - Error -> - Error - end; - Error -> - Error - end; + getbyname_tm(Name,?S_AAAA,Timer); gethostbyname_tm(_Name, _Family, _Timer) -> {error, einval}. |