[mle] abort Address Solicit on partition change (#2481)

This commit aborts the Address Solicit transaction on a partition change.
Doing so avoids having Address Solicit messages being sent to the wrong
Leader address and delays caused by waiting for the previous Address Solicit
transaction to time out.
This commit is contained in:
Jonathan Hui
2018-01-16 17:00:02 +00:00
committed by GitHub
parent 011a2d14c9
commit 1f4b082f2b
4 changed files with 13 additions and 0 deletions
+1
View File
@@ -842,6 +842,7 @@ void Mle::SetLeaderData(uint32_t aPartitionId, uint8_t aWeighting, uint8_t aLead
{
if (mLeaderData.GetPartitionId() != aPartitionId)
{
GetNetif().GetMle().HandlePartitionChange();
mLastPartitionId = mLeaderData.GetPartitionId();
mLastPartitionRouterIdSequence = GetNetif().GetMle().GetRouterIdSequence();
mLastPartitionIdTimeout = GetNetif().GetMle().GetNetworkIdTimeout();
+9
View File
@@ -90,6 +90,14 @@ MleRouter::MleRouter(Instance &aInstance):
SetRouterId(kInvalidRouterId);
}
void MleRouter::HandlePartitionChange(void)
{
ThreadNetif &netif = GetNetif();
netif.GetAddressResolver().Clear();
netif.GetCoap().AbortTransaction(&MleRouter::HandleAddressSolicitResponse, this);
}
bool MleRouter::IsRouterRoleEnabled(void) const
{
return mRouterRoleEnabled && (mDeviceMode & ModeTlv::kModeFFD);
@@ -324,6 +332,7 @@ void MleRouter::StopLeader(void)
mAdvertiseTimer.Stop();
netif.GetNetworkDataLeader().Stop();
netif.UnsubscribeAllRoutersMulticast();
HandlePartitionChange();
}
otError MleRouter::HandleDetachStart(void)
+2
View File
@@ -815,6 +815,8 @@ private:
static bool IsSingleton(const RouteTlv &aRouteTlv);
void HandlePartitionChange(void);
Child *NewChild(void);
Child *FindChild(uint16_t aChildId);
Child *FindChild(const Mac::ExtAddress &aMacAddr);
+1
View File
@@ -151,6 +151,7 @@ private:
otError HandleDataRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
otError HandleNetworkDataUpdateRouter(void) { return OT_ERROR_NONE; }
otError HandleDiscoveryRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
void HandlePartitionChange(void) { }
void StopAdvertiseTimer(void) { }
otError ProcessRouteTlv(const RouteTlv &aRoute) { OT_UNUSED_VARIABLE(aRoute); return OT_ERROR_NONE; }