Bluetooth: Mesh: Logic fix for recvd unseg msgs

Fixed transport layer logic causing excessive processing of
some unsegmented messages

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
This commit is contained in:
Stine Åkredalen 2024-08-30 10:37:56 +02:00 committed by Anas Nashif
commit c89bca6f3f

View file

@ -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);
}