aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-07-29 12:03:04 +0200
committerRaimo Niskanen <[email protected]>2016-07-29 12:03:04 +0200
commite840e73ee03d51dd12c7ed6ec9cecbaae1663454 (patch)
tree59a6aa436dce962343ecb82f32d0d26f35c2b937
parent18d328f9e2275d13a1d469016916f7261a612951 (diff)
downloadotp-e840e73ee03d51dd12c7ed6ec9cecbaae1663454.tar.gz
otp-e840e73ee03d51dd12c7ed6ec9cecbaae1663454.tar.bz2
otp-e840e73ee03d51dd12c7ed6ec9cecbaae1663454.zip
Handle AF_UNSPEC and AF_UNDEFINED correctly
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin76236 -> 76268 bytes
-rw-r--r--erts/preloaded/src/prim_inet.erl6
2 files changed, 3 insertions, 3 deletions
diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam
index fba03d52bd..ae4861c336 100644
--- a/erts/preloaded/ebin/prim_inet.beam
+++ b/erts/preloaded/ebin/prim_inet.beam
Binary files differ
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index 560810d222..bcf16402b0 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -2401,13 +2401,13 @@ get_addrs([F|Addrs]) ->
{Addr,Rest} = get_addr(F, Addrs),
[Addr|get_addrs(Rest)].
-get_addr(?INET_AF_LOCAL, [0]) ->
- {{local,<<>>},[]};
get_addr(?INET_AF_LOCAL, [N|Addr]) ->
{A,Rest} = lists:split(N, Addr),
{{local,iolist_to_binary(A)},Rest};
+get_addr(?INET_AF_UNSPEC, Rest) ->
+ {{unspec,<<>>},Rest};
get_addr(?INET_AF_UNDEFINED, Rest) ->
- {{undefined,0},Rest};
+ {{undefined,<<>>},Rest};
get_addr(Family, [P1,P0|Addr]) ->
{IP,Rest} = get_ip(Family, Addr),
{{IP,?u16(P1, P0)},Rest}.