mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 09:57:47 +00:00
[mle] drop Child ID Response if Router IDs do not match (#7430)
The Child ID Response message contains the RLOC16 that the Parent assigns to the Child. Add a check to ensure that Parent's and Child's Router IDs match. If the Router IDs do not match, drop the Child ID Response message.
This commit is contained in:
@@ -3650,11 +3650,12 @@ void Mle::HandleChildIdResponse(const Message & aMessage,
|
||||
|
||||
VerifyOrExit(mAttachState == kAttachStateChildIdRequest);
|
||||
|
||||
// Leader Data
|
||||
SuccessOrExit(error = ReadLeaderData(aMessage, leaderData));
|
||||
|
||||
// ShortAddress
|
||||
SuccessOrExit(error = Tlv::Find<Address16Tlv>(aMessage, shortAddress));
|
||||
VerifyOrExit(RouterIdMatch(sourceAddress, shortAddress), error = kErrorRejected);
|
||||
|
||||
// Leader Data
|
||||
SuccessOrExit(error = ReadLeaderData(aMessage, leaderData));
|
||||
|
||||
// Network Data
|
||||
error = Tlv::FindTlvOffset(aMessage, Tlv::kNetworkData, networkDataOffset);
|
||||
|
||||
Reference in New Issue
Block a user