mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: ensure unique UUID for simple websocket nodes
This commit is contained in:
parent
7b01da03af
commit
335440d8ad
2 changed files with 4 additions and 9 deletions
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit dfd8bb23202c554b74d622dff40fb1bf16ced6c8
|
||||
Subproject commit 3f3296e01752eddc02c077cb9a7e43171f69c75e
|
11
lib/node.cpp
11
lib/node.cpp
|
@ -166,14 +166,9 @@ int node_parse(struct vnode *n, json_t *json, const char *name)
|
|||
if (ret)
|
||||
throw ConfigError(json, "node-config-node-uuid", "Failed to parse UUID: {}", uuid);
|
||||
}
|
||||
else {
|
||||
/* Generate UUID from hashed config */
|
||||
char *json_str = json_dumps(json, JSON_COMPACT | JSON_SORT_KEYS);
|
||||
|
||||
MD5((unsigned char*) json_str, strlen(json_str), (unsigned char*) &n->uuid);
|
||||
|
||||
free(json_str);
|
||||
}
|
||||
else
|
||||
/* Generate UUID from hashed config including node name */
|
||||
uuid_generate_from_json(n->uuid, json, name);
|
||||
|
||||
if (json_netem) {
|
||||
#ifdef WITH_NETEM
|
||||
|
|
Loading…
Add table
Reference in a new issue