diff options
author | Micael Karlberg <[email protected]> | 2018-07-23 10:57:25 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | 31ef72ceda0bf5bba902bf18f3b445950516d6af (patch) | |
tree | 30a33b29731cb246554ba90ac07527151a22939e /erts/preloaded/src | |
parent | 1c26ae984a79224ce64b40dbc7239bf9721bb096 (diff) | |
download | otp-31ef72ceda0bf5bba902bf18f3b445950516d6af.tar.gz otp-31ef72ceda0bf5bba902bf18f3b445950516d6af.tar.bz2 otp-31ef72ceda0bf5bba902bf18f3b445950516d6af.zip |
[socket-nif] Add support for socket (level ip) option recvopts
Added support for ip level socket option RECVOPTS.
OTP-14831
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r-- | erts/preloaded/src/socket.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl index 329223c443..49c7a3f56d 100644 --- a/erts/preloaded/src/socket.erl +++ b/erts/preloaded/src/socket.erl @@ -614,7 +614,7 @@ %% -define(SOCKET_OPT_IP_RECVERR, 20). -define(SOCKET_OPT_IP_RECVIF, 21). %% -define(SOCKET_OPT_IP_RECVDSTADDR, 22). -%% -define(SOCKET_OPT_IP_RECVOPTS, 23). +-define(SOCKET_OPT_IP_RECVOPTS, 23). %% -define(SOCKET_OPT_IP_RECVORIGDSTADDR, 24). -define(SOCKET_OPT_IP_RECVTOS, 25). -define(SOCKET_OPT_IP_RECVTTL, 26). @@ -2210,6 +2210,9 @@ enc_setopt_value(ip, nodefrag, V, _D, _T, _P) enc_setopt_value(ip, recvif, V, _D, _T, _P) when is_boolean(V) -> V; +enc_setopt_value(ip, recvopts, V, _D, _T, _P) + when is_boolean(V) -> + V; enc_setopt_value(ip, recvtos, V, _D, _T, _P) when is_boolean(V) -> V; @@ -2619,8 +2622,8 @@ enc_sockopt_key(ip = _L, recvif = _Opt, _Dir, _D, T, _P) ?SOCKET_OPT_IP_RECVIF; enc_sockopt_key(ip = L, recvdstaddr = Opt, _Dir, _D, _T, _P) -> not_supported({L, Opt}); -enc_sockopt_key(ip = L, recvopts = Opt, _Dir, _D, T, _P) when (T =/= stream) -> - not_supported({L, Opt}); +enc_sockopt_key(ip = _L, recvopts = _Opt, _Dir, _D, T, _P) when (T =/= stream) -> + ?SOCKET_OPT_IP_RECVOPTS; enc_sockopt_key(ip = L, recvorigdstaddr = Opt, _Dir, _D, _T, _P) -> not_supported({L, Opt}); enc_sockopt_key(ip, recvtos = _Opt, _Dir, _D, _T, _P) -> |