aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-02-07 12:04:16 +0100
committerMicael Karlberg <[email protected]>2019-02-22 19:45:52 +0100
commite4156fe240367b4ccad36277ff05d97ac0cb2a32 (patch)
tree26f1a460ea60804887e86eddbc0c8f2c3818e2eb
parentfa6e81982e8f41f58e1c20995b9e5644622bf40c (diff)
downloadotp-e4156fe240367b4ccad36277ff05d97ac0cb2a32.tar.gz
otp-e4156fe240367b4ccad36277ff05d97ac0cb2a32.tar.bz2
otp-e4156fe240367b4ccad36277ff05d97ac0cb2a32.zip
[socket] Local address on macOS Mojave
Fixed how to figure out local address on macOS Mojave. OTP-14831
-rw-r--r--erts/emulator/test/socket_SUITE.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl
index 012bff1a7b..f799186675 100644
--- a/erts/emulator/test/socket_SUITE.erl
+++ b/erts/emulator/test/socket_SUITE.erl
@@ -17250,17 +17250,22 @@ which_addr(_Domain, []) ->
?FAIL(no_address);
which_addr(Domain, [{"lo" ++ _, _}|IFL]) ->
which_addr(Domain, IFL);
-which_addr(Domain, [{_Name, IFO}|_IFL]) ->
- which_addr2(Domain, IFO);
+which_addr(Domain, [{_Name, IFO}|IFL]) ->
+ case which_addr2(Domain, IFO) of
+ {ok, Addr} ->
+ Addr;
+ {error, no_address} ->
+ which_addr(Domain, IFL)
+ end;
which_addr(Domain, [_|IFL]) ->
which_addr(Domain, IFL).
which_addr2(_Domain, []) ->
- ?FAIL(no_address);
+ {error, no_address};
which_addr2(inet = _Domain, [{addr, Addr}|_IFO]) when (size(Addr) =:= 4) ->
- Addr;
+ {ok, Addr};
which_addr2(inet6 = _Domain, [{addr, Addr}|_IFO]) when (size(Addr) =:= 8) ->
- Addr;
+ {ok, Addr};
which_addr2(Domain, [_|IFO]) ->
which_addr2(Domain, IFO).