mesh: Fix node composition change detection
authorBrian Gix <brian.gix@intel.com>
Wed, 15 Jul 2020 15:30:49 +0000 (08:30 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
This fixes a bug that caused disallowed composition changes from being
detected and rejected. The only fields that are allowed to freely change
are CID, PID, VID and CRPL.

Change-Id: I147eab5fac9f20b5d3cf2ef161776cc385fd470d
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/node.c

index eb05007..6c45fdb 100644 (file)
@@ -1595,7 +1595,7 @@ static bool check_req_node(struct managed_obj_request *req)
                node = req->node;
 
        node_comp = node_get_comp(node, 0, &node_len);
-       len = node_generate_comp(node, comp, sizeof(comp));
+       len = node_generate_comp(req->node, comp, sizeof(comp));
 
        /* If no page 0 exists, save it and return */
        if (req->type != REQUEST_TYPE_ATTACH || !node_len || !node_comp)