[mle] minor TLV and route table cleanup (#2807)

This commit is contained in:
Kamil Burzynski
2018-06-19 09:59:13 -07:00
committed by Jonathan Hui
parent b5f22dcb5d
commit 403723dc82
2 changed files with 6 additions and 9 deletions
+2 -2
View File
@@ -716,8 +716,8 @@ private:
kRouteCostMask = 0xf << kRouteCostOffset,
};
uint8_t mRouterIdSequence;
uint8_t mRouterIdMask[BitVectorBytes(Mle::kMaxRouterId)];
uint8_t mRouteData[Mle::kMaxRouters];
uint8_t mRouterIdMask[BitVectorBytes(Mle::kMaxRouterId + 1)];
uint8_t mRouteData[Mle::kMaxRouterId + 1];
} OT_TOOL_PACKED_END;
/**
+4 -7
View File
@@ -534,14 +534,11 @@ void RouterTable::ProcessTlv(const Mle::RouteTlv &aTlv)
}
else
{
if (IsAllocated(i))
{
Router *router = GetRouter(i);
Router *router = GetRouter(i);
assert(router != NULL);
router->SetNextHop(Mle::kInvalidRouterId);
RemoveNeighbor(*router);
}
assert(router != NULL);
router->SetNextHop(Mle::kInvalidRouterId);
RemoveNeighbor(*router);
mAllocatedRouterIds[i / 8] &= ~(1 << (i % 8));
}