mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: Provisioner ignores msg from removed node
This commit is contained in:
parent
e24641cc89
commit
41cef4b1bb
@ -1394,6 +1394,24 @@ static bool ready_to_recv(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool ignore_net_msg(u16_t src, u16_t dst)
|
||||||
|
{
|
||||||
|
if (IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
|
||||||
|
bt_mesh_is_provisioner_en() &&
|
||||||
|
BLE_MESH_ADDR_IS_UNICAST(dst) &&
|
||||||
|
bt_mesh_elem_find(dst)) {
|
||||||
|
/* If the destination address of the message is the element
|
||||||
|
* address of Provisioner, but Provisioner fails to find the
|
||||||
|
* node in its provisioning database, then this message will
|
||||||
|
* be ignored.
|
||||||
|
*/
|
||||||
|
if (!bt_mesh_provisioner_get_node_with_addr(src)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void bt_mesh_net_recv(struct net_buf_simple *data, s8_t rssi,
|
void bt_mesh_net_recv(struct net_buf_simple *data, s8_t rssi,
|
||||||
enum bt_mesh_net_if net_if)
|
enum bt_mesh_net_if net_if)
|
||||||
{
|
{
|
||||||
@ -1411,6 +1429,10 @@ void bt_mesh_net_recv(struct net_buf_simple *data, s8_t rssi,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ignore_net_msg(rx.ctx.addr, rx.ctx.recv_dst)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Save the state so the buffer can later be relayed */
|
/* Save the state so the buffer can later be relayed */
|
||||||
net_buf_simple_save(&buf, &state);
|
net_buf_simple_save(&buf, &state);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user