summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/dist.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r--erts/emulator/beam/dist.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index 9a760fd97f..2a2c4fd31b 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -4906,6 +4906,19 @@ BIF_RETTYPE setnode_2(BIF_ALIST_2)
success = (!ERTS_PROC_IS_EXITING(net_kernel)
& !ERTS_PROC_GET_DIST_ENTRY(net_kernel));
if (success) {
+ /*
+ * Ensure we don't use a nodename-creation pair with
+ * external identifiers existing in the system.
+ */
+ while (!0) {
+ ErlNode *nep;
+ if (creation < 4)
+ creation = 4;
+ nep = erts_find_node(BIF_ARG_1, creation);
+ if (!nep || erts_node_refc(nep) == 0)
+ break;
+ creation++;
+ }
inc_no_nodes();
erts_set_this_node(BIF_ARG_1, (Uint32) creation);
erts_this_dist_entry->creation = creation;
@@ -6246,7 +6259,7 @@ nodes(Process *c_p, Eterm node_types, Eterm options)
}
}
else {
- Eterm ks[2], *hp, keys_tuple = THE_NON_VALUE;
+ Eterm ks[2], *hp;
Uint map_size = 0, el_xtra, xtra;
ErtsHeapFactory hfact;
@@ -6281,8 +6294,7 @@ nodes(Process *c_p, Eterm node_types, Eterm options)
vs[map_size++] = eni->type;
}
- info_map = erts_map_from_sorted_ks_and_vs(&hfact, ks, vs,
- map_size, &keys_tuple);
+ info_map = erts_map_from_sorted_ks_and_vs(&hfact, ks, vs, map_size);
hp = erts_produce_heap(&hfact, 3+2, xtra);
@@ -6868,8 +6880,7 @@ send_nodes_mon_msgs(Process *c_p, Eterm what, Eterm node,
map_size++;
}
- info = erts_map_from_sorted_ks_and_vs(&hfact, ks, vs,
- map_size, NULL);
+ info = erts_map_from_sorted_ks_and_vs(&hfact, ks, vs, map_size);
ASSERT(is_value(info));
}
else { /* Info list */