diff options
author | MichaĆ Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com> | 2020-06-15 13:11:52 +0200 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-06-15 12:53:45 -0700 |
commit | f34b7e0ba8cdbabf5e26daa305b99834fbdd9844 (patch) | |
tree | 223e03c792eb628e65af530775a38619abd1a68f /mesh/node.c | |
parent | 8eb993e983013e8a12145d4a1eefbde45de9d421 (diff) | |
download | bluez-f34b7e0ba8cdbabf5e26daa305b99834fbdd9844.tar.gz |
mesh: Fix updating CID, PID, VID & CRPL on node attach
In 8a382262125787caf38a1f800ec8956a1bf71d85, we wanted to allow the
application to update certain composition fields. This patch makes it
work.
Diffstat (limited to 'mesh/node.c')
-rw-r--r-- | mesh/node.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesh/node.c b/mesh/node.c index 567f2e6db..81763e5fa 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -1366,16 +1366,18 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr, static void update_composition(struct mesh_node *node, struct mesh_node *attach) { if (node->comp.cid != attach->comp.cid) - mesh_config_update_company_id(node->cfg, attach->comp.cid); + mesh_config_update_company_id(attach->cfg, node->comp.cid); if (node->comp.pid != attach->comp.pid) - mesh_config_update_product_id(node->cfg, attach->comp.pid); + mesh_config_update_product_id(attach->cfg, node->comp.pid); if (node->comp.vid != attach->comp.vid) - mesh_config_update_version_id(node->cfg, attach->comp.vid); + mesh_config_update_version_id(attach->cfg, node->comp.vid); if (node->comp.crpl != attach->comp.crpl) - mesh_config_update_crpl(node->cfg, attach->comp.crpl); + mesh_config_update_crpl(attach->cfg, node->comp.crpl); + + attach->comp = node->comp; } static bool check_req_node(struct managed_obj_request *req) |