aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-25 13:07:34 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commit673367a0c17349a8b57dfad5dbc349c68417c6a5 (patch)
tree915205912613ceb4df63cd23d249b68d2551dfdf /erts/preloaded
parent70a5b8d6a01b91a6044c6a5a0f8ed8919afd509b (diff)
downloadotp-673367a0c17349a8b57dfad5dbc349c68417c6a5.tar.gz
otp-673367a0c17349a8b57dfad5dbc349c68417c6a5.tar.bz2
otp-673367a0c17349a8b57dfad5dbc349c68417c6a5.zip
[socket-nif] Add support for socket (level ip) option transparent
Added support for ip level socket option TRANSPARENT. OTP-14831
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/socket.beambin59056 -> 59092 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 b5b18e1c3a..960a465fb6 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 28931e4ed0..c7589cbd48 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -644,7 +644,7 @@
-define(SOCKET_OPT_IP_ROUTER_ALERT, 28).
%% -define(SOCKET_OPT_IP_SNDSRCADDR, 29).
-define(SOCKET_OPT_IP_TOS, 30).
-%% -define(SOCKET_OPT_IP_TRANSPARENT, 31).
+-define(SOCKET_OPT_IP_TRANSPARENT, 31).
-define(SOCKET_OPT_IP_TTL, 32).
-define(SOCKET_OPT_IP_UNBLOCK_SOURCE, 33).
@@ -2274,6 +2274,9 @@ enc_setopt_value(ip, tos, V, _D, _T, _P)
(V =:= mincost) orelse
is_integer(V) ->
V;
+enc_setopt_value(ip, transparent, V, _D, _T, _P)
+ when is_boolean(V) ->
+ V;
enc_setopt_value(ip, ttl, V, _D, _T, _P)
when is_integer(V) ->
V;
@@ -2731,8 +2734,8 @@ enc_sockopt_key(ip, router_alert = _Opt, _Dir, _D, raw = _T, _P) ->
%% No such condition on linux (in the man page)...
enc_sockopt_key(ip, tos = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IP_TOS;
-enc_sockopt_key(ip = L, transparent = Opt, _Dir, _D, _T, _P) ->
- not_supported({L, Opt});
+enc_sockopt_key(ip = _L, transparent = _Opt, _Dir, _D, _T, _P) ->
+ ?SOCKET_OPT_IP_TRANSPARENT;
enc_sockopt_key(ip, ttl = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_IP_TTL;
enc_sockopt_key(ip = _L, unblock_source = _Opt, set = _Dir, _D, _T, _P) ->