[network-diagnostics] use the child timeout directly (#4136)

This commit changes the `NetworkDiagnostic::FillRequestedTlvs()` to
directly use the child timeout value in appended `TimeoutTlv`. This
addresses an issue where a user-specified long data poll interval
could cause the timeout TLV in diags response to be set higher than
actual child's timeout value.
This commit is contained in:
Abtin Keshavarzian
2019-09-08 21:37:52 -07:00
committed by Jonathan Hui
parent 2d3fd3b047
commit a11dafb686
+1 -1
View File
@@ -336,7 +336,7 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest,
{
TimeoutTlv tlv;
tlv.Init();
tlv.SetTimeout(TimerMilli::MsecToSec(Get<DataPollSender>().GetKeepAlivePollPeriod()));
tlv.SetTimeout(Get<Mle::MleRouter>().GetTimeout());
SuccessOrExit(error = aResponse.AppendTlv(tlv));
}