Skip to content

Commit

Permalink
Workaround for project-chip#12821, session ID collissions
Browse files Browse the repository at this point in the history
Add a central session ID allocator in mSystemState so aware consumers
can avoid collision.
  • Loading branch information
msandstedt committed Feb 1, 2022
1 parent bebbd74 commit 8eede1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controller/CHIPDeviceControllerSystemState.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <credentials/FabricTable.h>
#include <protocols/secure_channel/MessageCounterManager.h>
#include <protocols/secure_channel/SessionIDAllocator.h>
#include <transport/TransportMgr.h>
#include <transport/raw/UDP.h>
#if CONFIG_DEVICE_LAYER
Expand Down Expand Up @@ -130,6 +131,7 @@ class DeviceControllerSystemState
#if CONFIG_NETWORK_LAYER_BLE
Ble::BleLayer * BleLayer() { return mBleLayer; };
#endif
SessionIDAllocator * GetSessionIDAllocator() { return &mIDAllocator; }

private:
DeviceControllerSystemState(){};
Expand All @@ -145,6 +147,7 @@ class DeviceControllerSystemState
Messaging::ExchangeManager * mExchangeMgr = nullptr;
secure_channel::MessageCounterManager * mMessageCounterManager = nullptr;
FabricTable * mFabrics = nullptr;
SessionIDAllocator mIDAllocator;

std::atomic<uint32_t> mRefCount{ 1 };

Expand Down

0 comments on commit 8eede1f

Please sign in to comment.