diff options
author | Ingela Anderton Andin <[email protected]> | 2019-06-17 12:01:02 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-06-17 12:01:02 +0200 |
commit | d156b2cdceb8b2150522ba6c5ecca8734738e55e (patch) | |
tree | 01d5b2d90d37d3c8f3981d33912cc0dccdd6f18b /lib/kernel/src/inet6_udp.erl | |
parent | 8a17f3629530c033971cb1e0fd9ded7dd7a775c4 (diff) | |
parent | 585b41ca6ffbecee4cc5617c41069edd9867c8e4 (diff) | |
download | otp-d156b2cdceb8b2150522ba6c5ecca8734738e55e.tar.gz otp-d156b2cdceb8b2150522ba6c5ecca8734738e55e.tar.bz2 otp-d156b2cdceb8b2150522ba6c5ecca8734738e55e.zip |
Merge branch 'ingela/merge-294' into maint
Diffstat (limited to 'lib/kernel/src/inet6_udp.erl')
-rw-r--r-- | lib/kernel/src/inet6_udp.erl | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/kernel/src/inet6_udp.erl b/lib/kernel/src/inet6_udp.erl index 71db0357cd..cb95a69798 100644 --- a/lib/kernel/src/inet6_udp.erl +++ b/lib/kernel/src/inet6_udp.erl @@ -65,16 +65,25 @@ open(Port, Opts) -> {ok, _} -> exit(badarg) end. -send(S, Addr = {A,B,C,D,E,F,G,H}, P, Data) - when ?ip6(A,B,C,D,E,F,G,H), ?port(P) -> - prim_inet:sendto(S, Addr, P, Data). +send(S, {A,B,C,D,E,F,G,H} = IP, Port, Data) + when ?ip6(A,B,C,D,E,F,G,H), ?port(Port) -> + prim_inet:sendto(S, {IP, Port}, [], Data); +send(S, {{A,B,C,D,E,F,G,H}, Port} = Addr, AncData, Data) + when ?ip6(A,B,C,D,E,F,G,H), ?port(Port), is_list(AncData) -> + prim_inet:sendto(S, Addr, AncData, Data); +send(S, {?FAMILY, {{A,B,C,D,E,F,G,H}, Port}} = Address, AncData, Data) + when ?ip6(A,B,C,D,E,F,G,H), ?port(Port), is_list(AncData) -> + prim_inet:sendto(S, Address, AncData, Data); +send(S, {?FAMILY, {loopback, Port}} = Address, AncData, Data) + when ?port(Port), is_list(AncData) -> + prim_inet:sendto(S, Address, AncData, Data). send(S, Data) -> - prim_inet:sendto(S, {0,0,0,0,0,0,0,0}, 0, Data). + prim_inet:sendto(S, {any, 0}, [], Data). -connect(S, Addr = {A,B,C,D,E,F,G,H}, P) - when ?ip6(A,B,C,D,E,F,G,H), ?port(P) -> - prim_inet:connect(S, Addr, P). +connect(S, Addr = {A,B,C,D,E,F,G,H}, Port) + when ?ip6(A,B,C,D,E,F,G,H), ?port(Port) -> + prim_inet:connect(S, Addr, Port). recv(S, Len) -> prim_inet:recvfrom(S, Len). |