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 Dec 22, 2021
1 parent 4b4d070 commit e5b0b04
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 @@ -32,6 +32,7 @@
#include <app/DeviceControllerInteractionModelDelegate.h>
#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 @@ -140,6 +141,7 @@ class DeviceControllerSystemState
#if CONFIG_NETWORK_LAYER_BLE
Ble::BleLayer * BleLayer() { return mBleLayer; };
#endif
SessionIDAllocator * GetSessionIDAllocator() { return &mIDAllocator; }

private:
DeviceControllerSystemState(){};
Expand All @@ -156,6 +158,7 @@ class DeviceControllerSystemState
secure_channel::MessageCounterManager * mMessageCounterManager = nullptr;
FabricTable * mFabrics = nullptr;
DeviceControllerInteractionModelDelegate * mIMDelegate = nullptr;
SessionIDAllocator mIDAllocator;

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

Expand Down

0 comments on commit e5b0b04

Please sign in to comment.