From ce6400987f17d713666a9f32627a0f7b06d9f2bd Mon Sep 17 00:00:00 2001 From: Boyang Yu Date: Mon, 15 Nov 2021 11:31:18 -0800 Subject: [PATCH] Wait for port up before enabling macsec --- cfgmgr/macsecmgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cfgmgr/macsecmgr.cpp b/cfgmgr/macsecmgr.cpp index bcd693d427..39cf9eae02 100644 --- a/cfgmgr/macsecmgr.cpp +++ b/cfgmgr/macsecmgr.cpp @@ -547,10 +547,13 @@ bool MACsecMgr::isPortStateOk(const std::string & port_name) std::vector temp; std::string state; + std::string oper_status; if (m_statePortTable.get(port_name, temp) && get_value(temp, "state", state) - && state == "ok") + && state == "ok" + && get_value(temp, "netdev_oper_status", oper_status) + && oper_status == "up") { SWSS_LOG_DEBUG("Port '%s' is ready", port_name.c_str()); return true;