Skip to contentSkip to conversation

mesh: Fix node composition change detection

PATCH Applied Brian Gix 2 participants 3 messages Jul 15, 2020 – Jul 16, 2020 Bluetooth drivers

lore
Share & tools
lore

Brian Gix

author
#0 lore raw

PATCH 1/1 mesh: Fix node composition change detection

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.

---
 mesh/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mesh/node.c +1 -1
index c61167bda..9b97aa927 100644
@@ -1579,7 +1579,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)
Signature · 1 line
2.25.4
#1 lore raw

LGTM and solves problem. Please merge it.

/PF

Quoted 20 lines · Brian Gix

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.

---
  mesh/node.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mesh/node.c +1 -1
index c61167bda..9b97aa927 100644
@@ -1579,7 +1579,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)
author Applied
#2 lore raw
In reply to Brian Gix

Applied

Quoted 20 lines · Brian Gix

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.

---
 mesh/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mesh/node.c +1 -1
index c61167bda..9b97aa927 100644
@@ -1579,7 +1579,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)