From 2a78347bc0eb9ca464b3d0be8963a5078044599e Mon Sep 17 00:00:00 2001 From: Trond Einar Snekvik Date: Fri, 15 May 2020 09:44:06 +0200 Subject: [PATCH] Bluetooth: Mesh: Friend with unknown appkey 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. Fixes #24014. Signed-off-by: Trond Einar Snekvik --- subsys/bluetooth/mesh/transport.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/mesh/transport.c b/subsys/bluetooth/mesh/transport.c index 56eefdd728ffa9..b2fd0d620825e2 100644 --- a/subsys/bluetooth/mesh/transport.c +++ b/subsys/bluetooth/mesh/transport.c @@ -911,9 +911,11 @@ static int sdu_recv_unseg(struct bt_mesh_net_rx *rx, u8_t hdr, return 0; } - BT_WARN("No matching AppKey"); + if (rx->local_match) { + BT_WARN("No matching AppKey"); + } - return -EINVAL; + return 0; } static int sdu_recv_seg(struct seg_rx *seg, u8_t hdr, u8_t aszmic, @@ -1005,9 +1007,11 @@ static int sdu_recv_seg(struct seg_rx *seg, u8_t hdr, u8_t aszmic, return 0; } - BT_WARN("No matching AppKey"); + if (rx->local_match) { + BT_WARN("No matching AppKey"); + } - return -EINVAL; + return 0; } static struct seg_tx *seg_tx_lookup(u16_t seq_zero, u8_t obo, u16_t addr)