aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-12 10:42:19 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commitea680e88b967440b2ecd925321ebb5dd48461608 (patch)
tree9524817c1314103536dbcb6910e294602986433f /erts/preloaded
parente0f27afac1cb3e3a5567a05081d0cf307c154b0d (diff)
downloadotp-ea680e88b967440b2ecd925321ebb5dd48461608.tar.gz
otp-ea680e88b967440b2ecd925321ebb5dd48461608.tar.bz2
otp-ea680e88b967440b2ecd925321ebb5dd48461608.zip
[socket-nif] Add support for socket (level ip) option multicast_all
Added support for the IP option MULTICAST_ALL. OTP-14831
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/socket.beambin44676 -> 44744 bytes
-rw-r--r--erts/preloaded/src/socket.erl9
2 files changed, 6 insertions, 3 deletions
diff --git a/erts/preloaded/ebin/socket.beam b/erts/preloaded/ebin/socket.beam
index 7ca451b6c5..ca05529931 100644
--- a/erts/preloaded/ebin/socket.beam
+++ b/erts/preloaded/ebin/socket.beam
Binary files differ
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl
index 5338f0d988..643f59467b 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -527,7 +527,7 @@
%% -define(SOCKET_OPT_IP_MSFILTER, 10).
-define(SOCKET_OPT_IP_MTU, 11).
-define(SOCKET_OPT_IP_MTU_DISCOVER, 12).
-%% -define(SOCKET_OPT_IP_MULTICAST_ALL, 13).
+-define(SOCKET_OPT_IP_MULTICAST_ALL, 13).
-define(SOCKET_OPT_IP_MULTICAST_IF, 14).
-define(SOCKET_OPT_IP_MULTICAST_LOOP, 15).
-define(SOCKET_OPT_IP_MULTICAST_TTL, 16).
@@ -1992,6 +1992,9 @@ enc_setopt_value(ip, mtu_discover, V, _D, _T, _P)
(V =:= probe) orelse
is_integer(V) ->
V;
+enc_setopt_value(ip, multicast_all, V, _D, _T, _P)
+ when is_boolean(V) ->
+ V;
enc_setopt_value(ip, multicast_if, V, _D, _T, _P)
when (V =:= any) orelse (is_tuple(V) andalso (size(V) =:= 4)) ->
V;
@@ -2289,8 +2292,8 @@ enc_sockopt_key(ip = _L, mtu = _Opt, get = _Dir, _D, _T, _P) ->
?SOCKET_OPT_IP_MTU;
enc_sockopt_key(ip = _L, mtu_discover = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IP_MTU_DISCOVER;
-enc_sockopt_key(ip = L, multicast_all = Opt, _Dir, _D, _T, _P) ->
- not_supported({L, Opt});
+enc_sockopt_key(ip = _L, multicast_all = _Opt, _Dir, _D, _T, _P) ->
+ ?SOCKET_OPT_IP_MULTICAST_ALL;
enc_sockopt_key(ip = _L, multicast_if = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IP_MULTICAST_IF;
enc_sockopt_key(ip = _L, multicast_loop = _Opt, _Dir, _D, _T, _P) ->