From f53b16472f568fbad2d82e29d2c841f234a25090 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 26 Feb 2026 14:00:57 -0600 Subject: [PATCH] [nexus] fix intermittent failure in test 5.6.6 (#12573) This commit fixes an intermittent failure in Nexus test 5.6.6 by ensuring that the OnMeshPrefixConfig object is properly initialized before use. The OnMeshPrefixConfig object is declared on the stack and, if not explicitly cleared, may contain garbage values in its bit-fields (such as mDhcp or mPreference). This can cause the subsequent call to AddOnMeshPrefix() to fail its IsValid() check, resulting in a kErrorInvalidArgs error and a test failure. Changes: - Call config.Clear() after declaring the OnMeshPrefixConfig object in tests/nexus/test_5_6_6.cpp to ensure all fields are initialized to zero. This aligns the test implementation with other Nexus tests and improves the robustness of the test suite in simulation environments. Verified to pass in the Nexus simulation environment. --- tests/nexus/test_5_6_6.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/nexus/test_5_6_6.cpp b/tests/nexus/test_5_6_6.cpp index 19f936012..f944386e9 100644 --- a/tests/nexus/test_5_6_6.cpp +++ b/tests/nexus/test_5_6_6.cpp @@ -159,6 +159,7 @@ void Test5_6_6(void) { NetworkData::OnMeshPrefixConfig config; + config.Clear(); SuccessOrQuit(config.GetPrefix().FromString(kPrefix1)); config.mStable = true; config.mOnMesh = true;