diff mbox series

[BlueZ] mesh: Fix lookup of non-vendor models in node config

Message ID 20200811200712.21083-1-michal.lowas-rzechonek@silvair.com (mailing list archive)
State Superseded
Headers show
Series [BlueZ] mesh: Fix lookup of non-vendor models in node config | expand

Commit Message

MichaƂ Lowas-Rzechonek Aug. 11, 2020, 8:07 p.m. UTC
In commit 81a0868b082c ("mesh: Move model functionality out of node.c
to model.c"), we changed the way we handle model ids, resulting
in vendor mask not being stripped from model id before update_bindings()
calls mesh_config_model_binding_*().

This resulted in get_element_model not finding the model.
---
 mesh/mesh-config-json.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index ae1099fcb..ce8dd5cde 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
@@ -170,11 +170,6 @@  static json_object *get_element_model(json_object *jnode, int ele_idx,
 	size_t len;
 	char buf[9];
 
-	if (!vendor)
-		snprintf(buf, 5, "%4.4x", (uint16_t)mod_id);
-	else
-		snprintf(buf, 9, "%8.8x", mod_id);
-
 	if (!json_object_object_get_ex(jnode, "elements", &jelements))
 		return NULL;
 
@@ -190,7 +185,7 @@  static json_object *get_element_model(json_object *jnode, int ele_idx,
 		return NULL;
 
 	if (!vendor) {
-		snprintf(buf, 5, "%4.4x", mod_id);
+		snprintf(buf, 5, "%4.4x", (uint16_t)mod_id);
 		len = 4;
 	} else {
 		snprintf(buf, 9, "%8.8x", mod_id);