From 2f9bd174d02fb67929d90e1f1d3c1fa05f9b2c35 Mon Sep 17 00:00:00 2001 From: rongli Date: Mon, 11 Jun 2018 23:56:22 +0800 Subject: [PATCH] [network-diagnostic] REED should omit ChildTable TLV request (#2772) --- src/core/thread/network_diagnostic.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/network_diagnostic.cpp index 8a35b907f..e22af31ce 100644 --- a/src/core/thread/network_diagnostic.cpp +++ b/src/core/thread/network_diagnostic.cpp @@ -394,13 +394,19 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest, case NetworkDiagnosticTlv::kSupplyVoltage: { // Thread 1.1.1 Specification Section 10.11.4.3: - // Omitted if the battery level is not measured, is unknown. + // Omitted if the supply voltage is not measured, is unknown. break; } case NetworkDiagnosticTlv::kChildTable: { - SuccessOrExit(error = AppendChildTable(aResponse)); + // Thread 1.1.1 Specification Section 10.11.2.2: + // If a Thread device is unable to supply a specific Diagnostic TLV, that TLV is omitted. + // Here only Leader or Router may have children. + if (netif.GetMle().GetRole() == OT_DEVICE_ROLE_LEADER || netif.GetMle().GetRole() == OT_DEVICE_ROLE_ROUTER) + { + SuccessOrExit(error = AppendChildTable(aResponse)); + } break; }