[PATCH BlueZ] Fix parsing composition data for custom models

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Custom model ids consist of model id and vendor id. Instead, vendor id was used twice to build model id.
---
 mesh/node.c    | 2 +-
 mesh/prov-db.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/node.c b/mesh/node.c
index 3c206dc36..b906754ae 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -432,7 +432,7 @@ bool node_parse_composition(struct mesh_node *node, uint8_t *data, uint16_t len)
 			len -= 2;
 		}
 		while (len >= 4 && v--) {
-			mod_id = get_le16(data);
+			mod_id = get_le16(data + 2);
 			vendor_id = get_le16(data);
 			mod_id |= (vendor_id << 16);
 			if (!node_set_model(node, ele->index, mod_id))
diff --git a/mesh/prov-db.c b/mesh/prov-db.c
index a012ef865..9add3f7c3 100644
--- a/mesh/prov-db.c
+++ b/mesh/prov-db.c
@@ -676,7 +676,7 @@ bool prov_db_add_node_composition(struct mesh_node *node, uint8_t *data,
 		}
 
 		while (len >= 4 && v--) {
-			mod_id = get_le16(data);
+			mod_id = get_le16(data + 2);
 			vendor_id = get_le16(data);
 			mod_id |= (vendor_id << 16);
 			data += 4;
-- 
2.13.6 (Apple Git-96)


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux