Skip to content

Commit

Permalink
Fix fabric index management in the fabric table. (#16587)
Browse files Browse the repository at this point in the history
* Fix fabric index management in the fabric table.

Before this change, the fabric index for a fabric table entry had to match its offset in the table.  Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1.

Furthermore, we did not use to persist our mNextAvailableFabricIndex,
so after a restart would start assigning fabric indices that
corresponded to deleted fabrics, instead of not-yet-used ones, even if
we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning
events.

This change decouples the fabric index from the table offset.  We now
store the list of fabric indices used and the fabric index we should
use for the next time a fabric is added.

* Fix TestCASESession compilation.

* Address review comments.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 11, 2023
1 parent 29af2a3 commit 1004956
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 104 deletions.
Loading

0 comments on commit 1004956

Please sign in to comment.