fix(ble_mesh): fix Friend queue losing segmented messages for LPN

(cherry picked from commit 1f4c6ee31b)

Co-authored-by: luoxu <luoxu@espressif.com>
This commit is contained in:
Luo Xu
2026-04-30 21:42:54 +08:00
parent d0feda6e14
commit 8971e3879e
+5 -6
View File
@@ -1270,12 +1270,11 @@ static void enqueue_friend_pdu(struct bt_mesh_friend *frnd,
net_buf_slist_put(&seg->queue, buf);
if (type == BLE_MESH_FRIEND_PDU_COMPLETE) {
struct net_buf *sbuf;
while ((sbuf = (void *)sys_slist_get(&seg->queue))) {
sbuf->frags = NULL;
sbuf->flags &= ~NET_BUF_FRAGS;
}
/* First merge segments into the main queue (preserves the slist chain),
* then clear frags/flags. Note: net_buf.frags and net_buf.node.next
* share the same memory (union), so clearing frags before merge would
* break the slist chain.
*/
sys_slist_merge_slist(&frnd->queue, &seg->queue);
frnd->queue_size += seg->seg_count;