Skip to content

Commit

Permalink
Wait for port up before enabling macsec
Browse files Browse the repository at this point in the history
  • Loading branch information
byu343 committed Nov 15, 2021
1 parent 4912a77 commit ce64009
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cfgmgr/macsecmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,13 @@ bool MACsecMgr::isPortStateOk(const std::string & port_name)

std::vector<FieldValueTuple> 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;
Expand Down

0 comments on commit ce64009

Please sign in to comment.