From 330b119be68f95f6f8fbdef8bf16bba314783973 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sat, 29 Apr 2023 00:30:12 +0200 Subject: [erts] ensure no mix of external and internal identifiers Silently reject proposed creation and select another one when a node goes alive if there are external identifiers in the system with the proposed creation and the same node name that are to be used. Such identifiers would not work as expected in various situations, and are not from the instance of the node that are about to go alive. --- erts/emulator/beam/erl_node_tables.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'erts/emulator/beam/erl_node_tables.c') diff --git a/erts/emulator/beam/erl_node_tables.c b/erts/emulator/beam/erl_node_tables.c index 75c6b6abce..9784e17660 100644 --- a/erts/emulator/beam/erl_node_tables.c +++ b/erts/emulator/beam/erl_node_tables.c @@ -881,6 +881,18 @@ erts_node_table_info(fmtfn_t to, void *to_arg) erts_rwmtx_runlock(&erts_node_table_rwmtx); } +ErlNode *erts_find_node(Eterm sysname, Uint32 creation) +{ + ErlNode *res; + ErlNode ne; + ne.sysname = sysname; + ne.creation = creation; + + erts_rwmtx_rlock(&erts_node_table_rwmtx); + res = hash_get(&erts_node_table, (void *) &ne); + erts_rwmtx_runlock(&erts_node_table_rwmtx); + return res; +} ErlNode *erts_find_or_insert_node(Eterm sysname, Uint32 creation, Eterm book) { -- cgit v1.2.1