From 458cfe151cded03aca2dfe6ca8c9a530b6e19118 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 10 Sep 2020 11:20:58 +0200 Subject: [PATCH] node: do not re-check node-type in node_parse() --- lib/node.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/node.cpp b/lib/node.cpp index 10945bf38..26a980953 100644 --- a/lib/node.cpp +++ b/lib/node.cpp @@ -138,12 +138,11 @@ int node_parse(struct vnode *n, json_t *json, const char *name) json_error_t err; json_t *json_netem = nullptr; - const char *type, *uuid = nullptr; + const char *uuid = nullptr; n->name = strdup(name); - ret = json_unpack_ex(json, &err, 0, "{ s: s, s?: s, s?: b }", - "type", &type, + ret = json_unpack_ex(json, &err, 0, "{ s?: s, s?: b }", "uuid", &uuid, "enabled", &enabled ); @@ -162,11 +161,6 @@ int node_parse(struct vnode *n, json_t *json, const char *name) return ret; #endif /* __linux__ */ - nt = node_type_lookup(type); - assert(nt == node_type(n)); - - n->_vt = nt; - if (uuid) { ret = uuid_parse(uuid, n->uuid); if (ret)