From ede320712e6b5a05b54aa4eb544ac45fd3c47bb3 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 4 Feb 2019 21:08:11 -0800 Subject: [PATCH] [mle] use IsAttached() to start border agent (#3554) --- src/core/thread/mle.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 7a0df26a2..7c10da011 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -334,8 +334,7 @@ void Mle::SetRole(otDeviceRole aRole) } #if OPENTHREAD_ENABLE_BORDER_AGENT - // Start border agent - if (aRole == OT_DEVICE_ROLE_ROUTER || aRole == OT_DEVICE_ROLE_LEADER || aRole == OT_DEVICE_ROLE_CHILD) + if (IsAttached()) { SuccessOrExit(GetInstance().Get().Start()); }