diff --git a/hsflowd.spec b/hsflowd.spec index ba9fbe9..f86eb3c 100644 --- a/hsflowd.spec +++ b/hsflowd.spec @@ -1,7 +1,7 @@ Summary: host sFlow daemon Name: hsflowd Version: 2.1.04 -Release: 4 +Release: 5 License: http://sflow.net/license.html Group: Applications/Internet URL: http://sflow.net diff --git a/src/Linux/hsflowd.c b/src/Linux/hsflowd.c index b339ff9..60533a8 100644 --- a/src/Linux/hsflowd.c +++ b/src/Linux/hsflowd.c @@ -2314,7 +2314,7 @@ extern "C" { SFL_MAX_OSRELEASE_CHARS); // Helpful for version to be in every debug log. - myLog(LOG_INFO, "%s version %s\n", argv[0], STRINGIFY_DEF(HSP_VERSION)); + myLog(LOG_INFO, "%s version %s", argv[0], STRINGIFY_DEF(HSP_VERSION)); // some modules can be triggered to load even if they are not // explicitly in the config file - but do this before we read diff --git a/src/Linux/mod_sonic.c b/src/Linux/mod_sonic.c index d06d645..46c6c70 100644 --- a/src/Linux/mod_sonic.c +++ b/src/Linux/mod_sonic.c @@ -270,9 +270,14 @@ extern "C" { static SFLAdaptor *portGetAdaptor(EVMod *mod, HSPSonicPort *prt) { HSP *sp = (HSP *)EVROOTDATA(mod); - if(prt->osIndex == HSP_SONIC_IFINDEX_UNDEFINED) - return NULL; - return adaptorByIndex(sp, prt->osIndex); + //if(prt->osIndex == HSP_SONIC_IFINDEX_UNDEFINED) + // return NULL; + SFLAdaptor *adaptor = adaptorByIndex(sp, prt->osIndex); + if(adaptor == NULL) + adaptor = adaptorByName(sp, prt->portName); + if(adaptor == NULL) + adaptor = adaptorByAlias(sp, prt->portName); + return adaptor; } static bool portSyncToAdaptor(EVMod *mod, HSPSonicPort *prt, bool sync) { @@ -997,7 +1002,7 @@ extern "C" { HSPAdaptorNIO *nio = ADAPTOR_NIO(adaptor); if(nio && (nio->switchPort != flag)) { - EVDebug(mod, 1, "setting port %s switchPort flag from %u to %u\n", + EVDebug(mod, 1, "setting port %s switchPort flag from %u to %u", prt->portName, nio->switchPort, flag); @@ -1346,7 +1351,10 @@ extern "C" { redisReply *c_name = reply->element[ii]; redisReply *c_val = reply->element[ii + 1]; if(c_name->type == REDIS_REPLY_STRING) { - EVDebug(mod, 1, "portCounters: %s=%s", c_name->str, db_replyStr(c_val, db->replyBuf, YES)); + EVDebug(mod, 2, "portCounters: %s %s=%s", + prt->portName, + c_name->str, + db_replyStr(c_val, db->replyBuf, YES)); if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFIN_UCASTS)) prt->ctrs.pkts_in = db_getU32(c_val);