diff --git a/cfgmgr/macsecmgr.cpp b/cfgmgr/macsecmgr.cpp index bf5344c8d0..57fdcd4c9a 100644 --- a/cfgmgr/macsecmgr.cpp +++ b/cfgmgr/macsecmgr.cpp @@ -24,11 +24,10 @@ using namespace std; using namespace swss; -#define WPA_SUPPLICANT_CMD "./wpa_supplicant" -#define WPA_CLI_CMD "./wpa_cli" -#define WPA_CONF "./wpa.conf" -// #define SOCK_DIR "/var/run/macsec/" -#define SOCK_DIR "./" +#define WPA_SUPPLICANT_CMD "/sbin/wpa_supplicant" +#define WPA_CLI_CMD "/sbin/wpa_cli" +#define WPA_CONF "/etc/wpa_supplicant.conf" +#define SOCK_DIR "/var/run/" constexpr std::uint64_t RETRY_TIME = 30; @@ -64,13 +63,21 @@ static bool get_value( auto value_opt = swss::fvsGetValue(ta, field, true); if (!value_opt) { - SWSS_LOG_WARN("Cannot find field : %s", field.c_str()); + SWSS_LOG_DEBUG("Cannot find field : %s", field.c_str()); return false; } - lexical_convert(*value_opt, value); + try + { + lexical_convert(*value_opt, value); + } + catch(const boost::bad_lexical_cast &e) + { + SWSS_LOG_ERROR("Cannot convert value(%s) in field(%s)", value_opt->c_str(), field.c_str()); + return false; + } - return false; + return true; } static void wpa_cli_commands(std::ostringstream & ostream) diff --git a/cfgmgr/macsecmgr.h b/cfgmgr/macsecmgr.h index 50bd04bbcf..eaefbd3e8b 100644 --- a/cfgmgr/macsecmgr.h +++ b/cfgmgr/macsecmgr.h @@ -27,7 +27,7 @@ class MACsecMgr : public Orch using TaskArgs = std::vector; struct MACsecProfile { - std::uint8_t priority; + std::uint32_t priority; std::string cipher_suite; std::string primary_cak; std::string primary_ckn; diff --git a/cfgmgr/macsecmgrd.cpp b/cfgmgr/macsecmgrd.cpp index 2cad8fc56e..f77e3d8c07 100644 --- a/cfgmgr/macsecmgrd.cpp +++ b/cfgmgr/macsecmgrd.cpp @@ -47,7 +47,7 @@ int main(int argc, char **argv) try { - // Logger::linkToDbNative("macsecmgrd"); + Logger::linkToDbNative("macsecmgrd"); SWSS_LOG_NOTICE("--- Starting macsecmgrd ---"); swss::DBConnector cfgDb("CONFIG_DB", 0);