diff options
author | Rickard Green <rickard@erlang.org> | 2023-04-29 00:30:12 +0200 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2023-04-29 00:59:16 +0200 |
commit | 330b119be68f95f6f8fbdef8bf16bba314783973 (patch) | |
tree | f78d545d1f7f2ff98410150028981f14e9f527b5 /erts/emulator/beam/erl_node_tables.c | |
parent | 3002f55f409f44122d3a45ac53bfd453e9aa2cb2 (diff) | |
download | erlang-330b119be68f95f6f8fbdef8bf16bba314783973.tar.gz |
[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.
Diffstat (limited to 'erts/emulator/beam/erl_node_tables.c')
-rw-r--r-- | erts/emulator/beam/erl_node_tables.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) { |