diff options
author | Micael Karlberg <bmk@erlang.org> | 2019-05-29 13:58:52 +0200 |
---|---|---|
committer | Micael Karlberg <bmk@erlang.org> | 2019-06-14 12:17:58 +0200 |
commit | 0434173fdca9f4159b340aef4796d30f34b076f9 (patch) | |
tree | 66d75212fc7ec7f610b92791481852ee7833dbf7 /erts | |
parent | bc1a22adae40c6b8427b8ee8ec50773216a4ade1 (diff) | |
download | otp-0434173fdca9f4159b340aef4796d30f34b076f9.tar.gz otp-0434173fdca9f4159b340aef4796d30f34b076f9.tar.bz2 otp-0434173fdca9f4159b340aef4796d30f34b076f9.zip |
[esock|test] Ensure only "real" IPv6 address'es are accepted
When geting the local address, make sure we don't accept
the loopback address.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/test/socket_SUITE.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl index 0ec097836b..d8cb1013e9 100644 --- a/erts/emulator/test/socket_SUITE.erl +++ b/erts/emulator/test/socket_SUITE.erl @@ -24057,9 +24057,13 @@ which_addr(Domain, [_|IFL]) -> which_addr2(_Domain, []) -> {error, no_address}; -which_addr2(inet = _Domain, [{addr, Addr}|_IFO]) when (size(Addr) =:= 4) -> +which_addr2(inet = _Domain, [{addr, Addr}|_IFO]) + when (size(Addr) =:= 4) andalso (element(1, Addr) =/= 127) -> {ok, Addr}; -which_addr2(inet6 = _Domain, [{addr, Addr}|_IFO]) when (size(Addr) =:= 8) -> +which_addr2(inet6 = _Domain, [{addr, Addr}|_IFO]) + when (size(Addr) =:= 8) andalso + (element(1, Addr) =/= 0) andalso + (element(1, Addr) =/= 16#fe80) -> {ok, Addr}; which_addr2(Domain, [_|IFO]) -> which_addr2(Domain, IFO). |