aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-01-28 17:36:31 +0100
committerSverker Eriksson <[email protected]>2019-01-28 19:43:24 +0100
commitad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb (patch)
tree2d8520bde623c7aeb6812f4fe63a597467812e79 /erts/preloaded
parenta4aeacd28e4e31d3d79b091afcdc528082be2865 (diff)
downloadotp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.tar.gz
otp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.tar.bz2
otp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.zip
erts: Add magic port control numbers
to increase the probablity of a nice badarg from erlang:port_control.
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin82228 -> 82260 bytes
-rw-r--r--erts/preloaded/src/prim_inet.erl3
2 files changed, 2 insertions, 1 deletions
diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam
index 990f57bf0a..33b9f490b7 100644
--- a/erts/preloaded/ebin/prim_inet.beam
+++ b/erts/preloaded/ebin/prim_inet.beam
Binary files differ
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index f1d938c9a4..1d2fa767fd 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -2679,12 +2679,13 @@ get_ip6([X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16 | T]) ->
?u16(X9,X10),?u16(X11,X12),?u16(X13,X14),?u16(X15,X16)},
T }.
+-define(ERTS_INET_DRV_CONTROL_MAGIC_NUMBER, 16#03f1a300).
%% Control command
ctl_cmd(Port, Cmd, Args) ->
?DBG_FORMAT("prim_inet:ctl_cmd(~p, ~p, ~p)~n", [Port,Cmd,Args]),
Result =
- try erlang:port_control(Port, Cmd, Args) of
+ try erlang:port_control(Port, Cmd+?ERTS_INET_DRV_CONTROL_MAGIC_NUMBER, Args) of
[?INET_REP_OK|Reply] -> {ok,Reply};
[?INET_REP] -> inet_reply;
[?INET_REP_ERROR|Err] -> {error,list_to_atom(Err)}