aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2016-04-25 16:13:41 +0100
committerMagnus Henoch <[email protected]>2016-04-25 16:13:41 +0100
commita178332b6c0a17b94f2c348501da669bfc13feeb (patch)
treefe9a095d2ac1c7cdb3a6274ba963d0f153a0b567 /lib/kernel
parentf2cef11a16d8d5f643cdf913b46042db71bff867 (diff)
downloadotp-a178332b6c0a17b94f2c348501da669bfc13feeb.tar.gz
otp-a178332b6c0a17b94f2c348501da669bfc13feeb.tar.bz2
otp-a178332b6c0a17b94f2c348501da669bfc13feeb.zip
Error reasons for more distribution errors
Add descriptive shutdown reasons when an incoming distribution connection is rejected because it is not on the "allowed" list or because it has an incorrect cookie. These error reasons can be seen after calling net_kernel:verbose(1). Distinguishing these failures is valuable, because the log message printed is otherwise identical.
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/src/dist_util.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index 580a896357..47d0c1b861 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -156,7 +156,7 @@ is_allowed(#hs_data{other_node = Node,
send_status(HSData, not_allowed),
error_msg("** Connection attempt from "
"disallowed node ~w ** ~n", [Node]),
- ?shutdown(Node);
+ ?shutdown2(Node, {is_allowed, not_allowed});
_ -> true
end.
@@ -607,10 +607,10 @@ recv_challenge_reply(#hs_data{socket = Socket,
_ ->
error_msg("** Connection attempt from "
"disallowed node ~w ** ~n", [NodeB]),
- ?shutdown(NodeB)
+ ?shutdown2(NodeB, {recv_challenge_reply_failed, bad_cookie})
end;
- _ ->
- ?shutdown(no_node)
+ Other ->
+ ?shutdown2(no_node, {recv_challenge_reply_failed, Other})
end.
recv_challenge_ack(#hs_data{socket = Socket, f_recv = FRecv,