diff mbox series

[BlueZ] mesh: Fix node composition change detection

Message ID 20200715153343.2115695-1-brian.gix@intel.com (mailing list archive)
State Accepted
Headers show
Series [BlueZ] mesh: Fix node composition change detection | expand

Commit Message

Brian Gix July 15, 2020, 3:33 p.m. UTC
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(-)

Comments

Przemysław Fierek July 16, 2020, 9:42 a.m. UTC | #1
LGTM and solves problem. Please merge it.

/PF

On 15.07.2020 17:33, Brian Gix wrote:
> 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(-)
>
> diff --git a/mesh/node.c b/mesh/node.c
> index c61167bda..9b97aa927 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -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)
Brian Gix July 16, 2020, 5:05 p.m. UTC | #2
Applied

On Wed, 2020-07-15 at 08:33 -0700, Brian Gix wrote:
> 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(-)
> 
> diff --git a/mesh/node.c b/mesh/node.c
> index c61167bda..9b97aa927 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -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)
diff mbox series

Patch

diff --git a/mesh/node.c b/mesh/node.c
index c61167bda..9b97aa927 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -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)