diff options
author | Lars Thorsen <[email protected]> | 2014-09-23 14:30:49 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2014-09-23 14:47:06 +0200 |
commit | cd14f6b5489060fb22c08e14ab0f74e7f09aa599 (patch) | |
tree | 9c91f19c6e875ae127c621a2d1a882c0e522ac9d /lib/orber/src/orber_iiop_outproxy.erl | |
parent | 743ed31108ee555db18d9833186865e85e34333e (diff) | |
download | otp-cd14f6b5489060fb22c08e14ab0f74e7f09aa599.tar.gz otp-cd14f6b5489060fb22c08e14ab0f74e7f09aa599.tar.bz2 otp-cd14f6b5489060fb22c08e14ab0f74e7f09aa599.zip |
[orber] Fix problem with IPv6 addresses in service context
Diffstat (limited to 'lib/orber/src/orber_iiop_outproxy.erl')
-rw-r--r-- | lib/orber/src/orber_iiop_outproxy.erl | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/orber/src/orber_iiop_outproxy.erl b/lib/orber/src/orber_iiop_outproxy.erl index 4ba5b05995..3adb40d01a 100644 --- a/lib/orber/src/orber_iiop_outproxy.erl +++ b/lib/orber/src/orber_iiop_outproxy.erl @@ -113,7 +113,7 @@ stop(Pid) -> init({connect, Host, Port, SocketType, SocketOptions, Parent, Key, NewKey}) -> process_flag(trap_exit, true), case catch orber_socket:connect(SocketType, Host, Port, - get_ip_family_opts(Host) ++ SocketOptions) of + orber_socket:get_ip_family_opts(Host) ++ SocketOptions) of {'EXCEPTION', _E} -> ignore; %% We used to reply the below but since this would generate a CRASH REPORT @@ -508,38 +508,3 @@ clear_queue(Proxy, RequestId, MRef) -> end end. -get_ip_family_opts(Host) -> - case inet:parse_address(Host) of - {ok, {_,_,_,_}} -> - [inet]; - {ok, {_,_,_,_,_,_,_,_}} -> - [inet6]; - {error, einval} -> - check_family_for_name(Host, orber_env:ip_version()) - end. - -check_family_for_name(Host, inet) -> - case inet:getaddr(Host, inet) of - {ok, _Address} -> - [inet]; - {error, _} -> - case inet:getaddrs(Host, inet6) of - {ok, _Address} -> - [inet6]; - {error, _} -> - [inet] - end - end; -check_family_for_name(Host, inet6) -> - case inet:getaddr(Host, inet6) of - {ok, _Address} -> - [inet6]; - {error, _} -> - case inet:getaddr(Host, inet) of - {ok, _Address} -> - [inet]; - {error, _} -> - [inet6] - end - end. - |