Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Mesh: Prevent duplicate cdb appkeys #69571

Conversation

Andrewpini
Copy link
Collaborator

Fixes issue where it is possible to store the same appkey multiple times in CDB implementation.

akredalen
akredalen previously approved these changes Feb 28, 2024
@Andrewpini Andrewpini force-pushed the fix_mesh_shell_cdb_appkey_add_duplicate_issue branch from 084cbcd to 1e6dbc8 Compare February 28, 2024 14:18
alxelax
alxelax previously approved these changes Feb 28, 2024
jhedberg
jhedberg previously approved these changes Feb 29, 2024
Copy link
Collaborator

@PavelVPV PavelVPV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the function doc

@Andrewpini Andrewpini dismissed stale reviews from jhedberg and alxelax via 8d26e90 February 29, 2024 09:48
@Andrewpini Andrewpini force-pushed the fix_mesh_shell_cdb_appkey_add_duplicate_issue branch from 1e6dbc8 to 8d26e90 Compare February 29, 2024 09:48
@Andrewpini Andrewpini force-pushed the fix_mesh_shell_cdb_appkey_add_duplicate_issue branch from 8d26e90 to c036680 Compare February 29, 2024 11:04
@Andrewpini Andrewpini added the DNM This PR should not be merged (Do Not Merge) label Feb 29, 2024
@Andrewpini
Copy link
Collaborator Author

I need to revise my fix, there is an issue for app_idx=0 now since this is the value all entries have before they are taken into use.

@Andrewpini Andrewpini force-pushed the fix_mesh_shell_cdb_appkey_add_duplicate_issue branch from c036680 to 25c26ff Compare February 29, 2024 11:48
@Andrewpini Andrewpini removed the DNM This PR should not be merged (Do Not Merge) label Feb 29, 2024
subsys/bluetooth/mesh/cdb.c Show resolved Hide resolved
include/zephyr/bluetooth/mesh/cdb.h Outdated Show resolved Hide resolved
Fixes issue where it is possible to store the same appkey
multiple times in CDB implementation.

Signed-off-by: Anders Storrø <[email protected]>
@Andrewpini Andrewpini force-pushed the fix_mesh_shell_cdb_appkey_add_duplicate_issue branch from 25c26ff to d9d66a5 Compare February 29, 2024 13:39
@@ -94,6 +94,7 @@ struct bt_mesh_cdb bt_mesh_cdb = {
},
.app_keys = {
[0 ... (CONFIG_BT_MESH_CDB_APP_KEY_COUNT - 1)] = {
.app_idx = BT_MESH_KEY_UNUSED,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fabiobaltieri fabiobaltieri merged commit 6af7ad5 into zephyrproject-rtos:main Mar 6, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants