aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/socket.erl
diff options
context:
space:
mode:
Diffstat (limited to 'erts/preloaded/src/socket.erl')
-rw-r--r--erts/preloaded/src/socket.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl
index e9b9f44a2c..fd273951bd 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -649,7 +649,7 @@
%% -define(SOCKET_OPT_IPV6_LEAVE_GROUP, 16).
-define(SOCKET_OPT_IPV6_MTU, 17).
-define(SOCKET_OPT_IPV6_MTU_DISCOVER, 18).
-%% -define(SOCKET_OPT_IPV6_MULTICAST_HOPS, 19).
+-define(SOCKET_OPT_IPV6_MULTICAST_HOPS, 19).
%% -define(SOCKET_OPT_IPV6_MULTICAST_IF, 20).
%% -define(SOCKET_OPT_IPV6_MULTICAST_LOOP, 21).
%% -define(SOCKET_OPT_IPV6_PORTRANGE, 22).
@@ -2268,6 +2268,12 @@ enc_setopt_value(ipv6, mtu_discover, V, _D, _T, _P)
(V =:= probe) orelse
is_integer(V) ->
V;
+enc_setopt_value(ipv6, multicast_hops, V, _D, _T, _P)
+ when (V =:= default) ->
+ -1;
+enc_setopt_value(ipv6, multicast_hops, V, _D, _T, _P)
+ when is_integer(V) andalso (V >= 0) andalso (V =< 255) ->
+ V;
enc_setopt_value(ipv6, v6only, V, _D, _T, _P) when is_boolean(V) ->
V;
enc_setopt_value(ipv6 = L, Opt, V, _D, _T, _P) ->
@@ -2692,8 +2698,8 @@ enc_sockopt_key(ipv6 = _L, mtu = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IPV6_MTU;
enc_sockopt_key(ipv6 = _L, mtu_discover = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IPV6_MTU_DISCOVER;
-enc_sockopt_key(ipv6 = L, multicast_hops = Opt, _Dir, _D, _T, _P) ->
- not_supported({L, Opt});
+enc_sockopt_key(ipv6 = _L, multicast_hops = _Opt, _Dir, _D, _T, _P) ->
+ ?SOCKET_OPT_IPV6_MULTICAST_HOPS;
enc_sockopt_key(ipv6 = L, multicast_if = Opt, _Dir, _D, T, _P)
when (T =:= dgram) orelse (T =:= raw) ->
not_supported({L, Opt});