Skip to content

Commit cbe3b8f

Browse files
LingaoMnordicjm
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: Fix missing clear dup cache
When lpn reject message, should clear dup cache to avoid dup check next mesh message. Signed-off-by: Lingao Meng <[email protected]> (cherry picked from commit 5867492)
1 parent 15a5612 commit cbe3b8f

File tree

1 file changed

+2
-1
lines changed
  • subsys/bluetooth/mesh

1 file changed

+2
-1
lines changed

subsys/bluetooth/mesh/net.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ static bool check_dup(struct net_buf_simple *data)
125125
}
126126
}
127127

128-
dup_cache[dup_cache_next++] = val;
129128
dup_cache_next %= ARRAY_SIZE(dup_cache);
129+
dup_cache[dup_cache_next++] = val;
130130

131131
return false;
132132
}
@@ -850,6 +850,7 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi,
850850
BT_WARN("Removing rejected message from Network Message Cache");
851851
/* Rewind the next index now that we're not using this entry */
852852
msg_cache[--msg_cache_next].src = BT_MESH_ADDR_UNASSIGNED;
853+
dup_cache[--dup_cache_next] = 0;
853854
}
854855

855856
/* Relay if this was a group/virtual address, or if the destination

0 commit comments

Comments
 (0)