From c89bca6f3fffd6c54493c376288631e79cbacfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Fri, 30 Aug 2024 10:37:56 +0200 Subject: [PATCH] Bluetooth: Mesh: Logic fix for recvd unseg msgs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed transport layer logic causing excessive processing of some unsegmented messages Signed-off-by: Stine Ã…kredalen --- subsys/bluetooth/mesh/transport.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subsys/bluetooth/mesh/transport.c b/subsys/bluetooth/mesh/transport.c index b8fb8d35122..42b459e167a 100644 --- a/subsys/bluetooth/mesh/transport.c +++ b/subsys/bluetooth/mesh/transport.c @@ -1666,6 +1666,14 @@ int bt_mesh_trans_recv(struct net_buf_simple *buf, struct bt_mesh_net_rx *rx) err = trans_seg(buf, rx, &pdu_type, &seq_auth, &seg_count); } else { seg_count = 1; + + /* Avoid further processing of unsegmented messages that are not a + * local match nor a Friend match, with the exception of ctl messages. + */ + if (!rx->ctl && !rx->local_match && !rx->friend_match) { + return 0; + } + err = trans_unseg(buf, rx, &seq_auth); }