[mle] mark former parent as valid after becoming router (#4582)

Commit a8638d7 added logic to invalidate the parent upon a role
change. However, when upgrading from child to router, the existing
implementation updates the role before copying the parent into into
the router table. As a result, a router	may not	have any connectivity
with the rest of the partition until after additional MLE exchanges.

This commit marks the newly created router entry as valid so that the
router retains connectivity.
This commit is contained in:
Jonathan Hui
2020-02-19 22:20:01 -08:00
committed by GitHub
parent 4d1f60d82e
commit 0823114dff
+1
View File
@@ -3988,6 +3988,7 @@ void MleRouter::HandleAddressSolicitResponse(Coap::Message * aMessage,
// Keep link to the parent in order to respond to Parent Requests before new link is established.
*router = mParent;
router->SetState(Neighbor::kStateValid);
router->SetNextHop(kInvalidRouterId);
router->SetCost(0);