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:
Wataru Ishida
2019-02-06 17:47:53 -08:00
committed by Wataru Ishida
parent 76b252a543
commit 839522d7c3

View File

@@ -13,7 +13,8 @@
class OIDAllocator {
public:
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) ) {
m_bitset.set(i);
return tai_object_id_t(i);