diff --git a/cfgmgr/intfmgr.cpp b/cfgmgr/intfmgr.cpp index 3e0ed862be0b..d0eaca21d93d 100644 --- a/cfgmgr/intfmgr.cpp +++ b/cfgmgr/intfmgr.cpp @@ -9,6 +9,7 @@ #include "shellcmd.h" #include "macaddress.h" #include "warm_restart.h" +#include using namespace std; using namespace swss; @@ -438,6 +439,11 @@ bool IntfMgr::isIntfStateOk(const string &alias) } else if (m_statePortTable.get(alias, temp)) { + auto state_opt = swss::fvsGetValue(temp, "state", true); + if (!state_opt) + { + return false; + } SWSS_LOG_DEBUG("Port %s is ready", alias.c_str()); return true; } diff --git a/cfgmgr/portmgr.cpp b/cfgmgr/portmgr.cpp index 8fc43ca47f2a..b385a5096a3d 100644 --- a/cfgmgr/portmgr.cpp +++ b/cfgmgr/portmgr.cpp @@ -6,6 +6,7 @@ #include "portmgr.h" #include "exec.h" #include "shellcmd.h" +#include using namespace std; using namespace swss; @@ -87,6 +88,12 @@ bool PortMgr::isPortStateOk(const string &alias) if (m_statePortTable.get(alias, temp)) { + auto state_opt = swss::fvsGetValue(temp, "state", true); + if (!state_opt) + { + return false; + } + SWSS_LOG_INFO("Port %s is ready", alias.c_str()); return true; } diff --git a/cfgmgr/teammgr.cpp b/cfgmgr/teammgr.cpp index 89377e7e2d58..b0e59c89a1be 100644 --- a/cfgmgr/teammgr.cpp +++ b/cfgmgr/teammgr.cpp @@ -5,6 +5,7 @@ #include "tokenize.h" #include "warm_restart.h" #include "portmgr.h" +#include #include #include @@ -72,6 +73,13 @@ bool TeamMgr::isPortStateOk(const string &alias) return false; } + auto state_opt = swss::fvsGetValue(temp, "state", true); + if (!state_opt) + { + SWSS_LOG_INFO("Port %s is not ready", alias.c_str()); + return false; + } + return true; }