mesh: Fix checking for model subscription address

Previously the code only checked if any of the models within an
element had the destination address in their subscription list. After
that check the specific model that the message was addressed to was
not verified to have that address in it's subscription list. This
patch fixes the problem.
This commit is contained in:
Michał Narajowski
2018-07-09 14:23:15 +02:00
parent a216e3745a
commit 91acdc4a87
+3 -5
View File
@@ -547,9 +547,7 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct os_mbuf *buf)
}
} else if (BT_MESH_ADDR_IS_GROUP(rx->ctx.recv_dst) ||
BT_MESH_ADDR_IS_VIRTUAL(rx->ctx.recv_dst)) {
if (!bt_mesh_elem_find_group(elem, rx->ctx.recv_dst)) {
continue;
}
/* find_op() will do proper model/group matching */
} else if (i != 0 ||
!bt_mesh_fixed_group_match(rx->ctx.recv_dst)) {
continue;
@@ -567,8 +565,8 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct os_mbuf *buf)
count = elem->vnd_model_count;
}
op = find_op(models, count, rx->ctx.recv_dst,
rx->ctx.app_idx, opcode, &model);
op = find_op(models, count, rx->ctx.recv_dst, rx->ctx.app_idx,
opcode, &model);
if (op) {
struct net_buf_simple_state state;