From f863a1b32855d37471b5e985752a90b5a30a853f Mon Sep 17 00:00:00 2001 From: lly Date: Tue, 26 May 2020 11:15:51 +0800 Subject: [PATCH] ble_mesh: Friend with unknown appkey [Zephyr] Ensures that friend messages are enqueued, even if the packet is received with an appkey is unknown to the friend. Previously, sdu_recv would return EINVAL if the appkey was unknown, which would prevent the lower transport layer from adding the packet to the friend queue. This is irrelevant for the logic in lower transport, and should not be returned as an error. --- components/bt/esp_ble_mesh/mesh_core/transport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/transport.c b/components/bt/esp_ble_mesh/mesh_core/transport.c index 432145595b..bc3d69bd17 100644 --- a/components/bt/esp_ble_mesh/mesh_core/transport.c +++ b/components/bt/esp_ble_mesh/mesh_core/transport.c @@ -837,9 +837,11 @@ static int sdu_recv(struct bt_mesh_net_rx *rx, u32_t seq, u8_t hdr, return 0; } - BT_WARN("%s, No matching AppKey", __func__); + if (rx->local_match) { + BT_WARN("%s, No matching AppKey", __func__); + } bt_mesh_free_buf(sdu); - return -EINVAL; + return 0; } static struct seg_tx *seg_tx_lookup(u16_t seq_zero, u8_t obo, u16_t addr)