diff options
author | Inga Stotland <inga.stotland@intel.com> | 2020-08-06 15:55:23 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-08-07 07:36:18 -0700 |
commit | ca5dfd4ea071c86ff291c688ec9ca3a9b02ae509 (patch) | |
tree | 543759150c82703d4f8f756e482e5bc49d4e5adb /mesh/node.c | |
parent | 347117afd8e0d467224395f1ab82c9d1879e69b7 (diff) | |
download | bluez-ca5dfd4ea071c86ff291c688ec9ca3a9b02ae509.tar.gz |
mesh: Use correct TTL value to send model publication
When sending model publishing data, use TTL value configured for
that publication instead of the default TTL value used for regular
messages.
Diffstat (limited to 'mesh/node.c')
-rw-r--r-- | mesh/node.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mesh/node.c b/mesh/node.c index 3dca73cef..4b70587ae 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -1983,7 +1983,7 @@ static struct l_dbus_message *publish_call(struct l_dbus *dbus, struct l_dbus_message_iter iter_data; uint16_t mod_id, src; struct node_element *ele; - uint8_t *data, ttl; + uint8_t *data; uint32_t len, id; int result; @@ -2010,10 +2010,8 @@ static struct l_dbus_message *publish_call(struct l_dbus *dbus, return dbus_error(msg, MESH_ERROR_INVALID_ARGS, "Incorrect data"); - ttl = mesh_net_get_default_ttl(node->net); - id = SET_ID(SIG_VENDOR, mod_id); - result = mesh_model_publish(node, id, src, ttl, data, len); + result = mesh_model_publish(node, id, src, data, len); if (result != MESH_ERROR_NONE) return dbus_error(msg, result, NULL); @@ -2030,7 +2028,7 @@ static struct l_dbus_message *vendor_publish_call(struct l_dbus *dbus, struct l_dbus_message_iter iter_data; uint16_t src, mod_id, vendor_id; struct node_element *ele; - uint8_t ttl, *data = NULL; + uint8_t *data = NULL; uint32_t len; int result; @@ -2057,8 +2055,7 @@ static struct l_dbus_message *vendor_publish_call(struct l_dbus *dbus, return dbus_error(msg, MESH_ERROR_INVALID_ARGS, "Incorrect data"); - ttl = mesh_net_get_default_ttl(node->net); - result = mesh_model_publish(node, SET_ID(vendor_id, mod_id), src, ttl, + result = mesh_model_publish(node, SET_ID(vendor_id, mod_id), src, data, len); if (result != MESH_ERROR_NONE) |