mirror of
https://github.com/Telecominfraproject/oopt-tai-implementations.git
synced 2025-11-01 10:38:08 +00:00
mux: fix oid allocater to start oid allocation from 1
0 is reserved for TAI_NULL_OBJECT_ID. It must not used for valid object id. Signed-off-by: Wataru Ishida <ishida@nel-america.com>
This commit is contained in:
committed by
Wataru Ishida
parent
76b252a543
commit
839522d7c3
@@ -13,7 +13,8 @@
|
|||||||
class OIDAllocator {
|
class OIDAllocator {
|
||||||
public:
|
public:
|
||||||
tai_object_id_t next() {
|
tai_object_id_t next() {
|
||||||
for (int i = 0; i < 256; i++) {
|
// TAI_NULL_OBJECT_ID == 0, start from i = 1
|
||||||
|
for (int i = 1; i < 256; i++) {
|
||||||
if ( !m_bitset.test(i) ) {
|
if ( !m_bitset.test(i) ) {
|
||||||
m_bitset.set(i);
|
m_bitset.set(i);
|
||||||
return tai_object_id_t(i);
|
return tai_object_id_t(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user