From bfba0ad6ebf4b6acbabc713354584818ed4bb485 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 27 Oct 2021 20:59:38 -0700 Subject: [PATCH] [vlanmgr]Fix for STATE_DB port check logic (#1980) * Updated checks for PORT entry in STATE_DB in vlanmgrd additionally check for presence of "state" attribute. This is to add Vlanmgrd check similar to #1936 Signed-off-by: Sudharsan Dhamal Gopalarathnam --- cfgmgr/vlanmgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cfgmgr/vlanmgr.cpp b/cfgmgr/vlanmgr.cpp index 5124cd5a7a0f..aa0237781993 100644 --- a/cfgmgr/vlanmgr.cpp +++ b/cfgmgr/vlanmgr.cpp @@ -7,6 +7,7 @@ #include "tokenize.h" #include "shellcmd.h" #include "warm_restart.h" +#include using namespace std; using namespace swss; @@ -461,6 +462,11 @@ bool VlanMgr::isMemberStateOk(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("%s is ready", alias.c_str()); return true; }