From 02c6ded8c76c7a5df850e6caa66ae2e6b9d9cc9f Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 3 May 2017 09:08:01 -0700 Subject: [PATCH] Enable short source address matching after the first indirect tx attempt (#1696) This commit changes the how to enable short source address matching for a sleepy child. We remove the check for a successful tx to trigger address mode change to handle the scenario where the child does receive "Child ID Response" but parent misses the 15.4 ack from child. If the "Child ID Response" does not make it to the child, then the child will need to send a new "Child ID Request" which will cause the parent to switch to using long address mode for source address matching. --- src/core/thread/mesh_forwarder.cpp | 16 ++++++++++------ src/core/thread/mesh_forwarder.hpp | 9 --------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index 7e173b2d0..672bbc37c 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -1491,12 +1491,16 @@ void MeshForwarder::HandleSentFrame(Mac::Frame &aFrame, ThreadError aError) child->SetIndirectFragmentOffset(0); child->SetIndirectMessage(NULL); - // add short address for subsequent indirect messages after - // one indirect message to valid sleepy devices is sent out successfully - if (aError == kThreadError_None) - { - mSourceMatchController.SetSrcMatchAsShort(*child, true); - } + // Enable short source address matching after the first indirect + // message transmission attempt to the child. We intentionally do + // not check for successful tx here to address the scenario where + // the child does receive "Child ID Response" but parent misses the + // 15.4 ack from child. If the "Child ID Response" does not make it + // to the child, then the child will need to send a new "Child ID + // Request" which will cause the parent to switch to using long + // address mode for source address matching. + + mSourceMatchController.SetSrcMatchAsShort(*child, true); } childIndex = mNetif.GetMle().GetChildIndex(*child); diff --git a/src/core/thread/mesh_forwarder.hpp b/src/core/thread/mesh_forwarder.hpp index 9bf143442..0704c578f 100644 --- a/src/core/thread/mesh_forwarder.hpp +++ b/src/core/thread/mesh_forwarder.hpp @@ -170,15 +170,6 @@ public: */ void UpdateIndirectMessages(void); - /** - * This method sets whether or not to perform source matching on the extended or short address for Frame Pending determination. - * - * @param[in] aChild A reference to the child. - * @param[in] aMatchShort TRUE to match on short source address, FALSE otherwise. - * - */ - void SetSrcMatchAsShort(Child &aChild, bool aMatchShort); - /** * This method returns a reference to the thread network interface instance. *