summaryrefslogtreecommitdiff
path: root/mesh
diff options
context:
space:
mode:
authorIsak Westin <isak.westin@loytec.com>2022-10-06 16:59:27 +0200
committerBrian Gix <brian.gix@intel.com>2022-10-07 07:59:24 -0700
commitdabf32b313c1dbfcbb434778541e4ab03bb2121e (patch)
tree56f9dcde95299cd115b5c656d36c40b67a1f8745 /mesh
parentfc598fa12c08b554fb31e1a75b76ec3377c4dbaa (diff)
downloadbluez-dabf32b313c1dbfcbb434778541e4ab03bb2121e.tar.gz
mesh: Fix msg cache ring buffer
The message cache should be a strict ring buffer, suppressed message should not move to the front of the queue.
Diffstat (limited to 'mesh')
-rw-r--r--mesh/net.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesh/net.c b/mesh/net.c
index a1b586a0b..3f42d962c 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -1026,12 +1026,11 @@ static bool msg_in_cache(struct mesh_net *net, uint16_t src, uint32_t seq,
.mic = mic,
};
- msg = l_queue_remove_if(net->msg_cache, match_cache, &tst);
+ msg = l_queue_find(net->msg_cache, match_cache, &tst);
if (msg) {
l_debug("Supressing duplicate %4.4x + %6.6x + %8.8x",
src, seq, mic);
- l_queue_push_head(net->msg_cache, msg);
return true;
}