Skip to content

Commit

Permalink
[nrf fromtree] Bluetooth: Mesh: Fix missing clear dup cache
Browse files Browse the repository at this point in the history
When lpn reject message, should clear dup cache to
avoid dup check next mesh message.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
(cherry picked from commit 5867492)
  • Loading branch information
LingaoM authored and nordicjm committed Oct 31, 2022
1 parent 15a5612 commit cbe3b8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subsys/bluetooth/mesh/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static bool check_dup(struct net_buf_simple *data)
}
}

dup_cache[dup_cache_next++] = val;
dup_cache_next %= ARRAY_SIZE(dup_cache);
dup_cache[dup_cache_next++] = val;

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

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

0 comments on commit cbe3b8f

Please sign in to comment.