mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 07:59:51 +00:00
[network-data] add check for invalid router IDs (#4544)
It is posisble for a leader to receive SVR_DATA.ntf messages attempting to register with a router ID that is not valid on the leader. This commit does not allow registering network data with invalid router IDs to avoid having stale network data that persists.
This commit is contained in:
@@ -727,6 +727,8 @@ otError Leader::RegisterNetworkData(uint16_t aRloc16, uint8_t *aTlvs, uint8_t aT
|
||||
uint8_t oldTlvs[NetworkData::kMaxSize];
|
||||
uint8_t oldTlvsLength = NetworkData::kMaxSize;
|
||||
|
||||
VerifyOrExit(Get<RouterTable>().IsAllocated(Mle::Mle::RouterIdFromRloc16(aRloc16)), error = OT_ERROR_NO_ROUTE);
|
||||
|
||||
// Verify that `aTlvs` only contains entries matching `aRloc16`.
|
||||
SuccessOrExit(error = RlocLookup(aRloc16, rlocIn, rlocStable, aTlvs, aTlvsLength, kMatchModeRloc16,
|
||||
/* aAllowOtherEntries */ false));
|
||||
|
||||
Reference in New Issue
Block a user