[AGENT++] SNMPv3_MP_UNKNOWN_PDU_HANDLERS error
Jochen Katz
katz at agentpp.com
Thu Nov 8 23:00:16 CET 2007
Hi Anurag
> We are using version SNMP++v3.2.21a of snmp++ .
if possible please go to v3.2.22
> We are seeing the following error "Unknown PDU handlers"
> (SNMPv3_MP_UNKNOWN_PDU_HANDLERS) returned from the snmp++ on get and
> walk methods with SNMPv3.
> Please suggest ways to debug and fix this issue ?
First enable logging ("-D_DEBUG" in Makefile and set log filters), to
see at which place in v3MP this error is returned: I would assume
"Received rspMsg without outstanding request."
DefaultLog::log()->set_filter(ERROR_LOG, 15);
DefaultLog::log()->set_filter(WARNING_LOG, 15);
DefaultLog::log()->set_filter(EVENT_LOG, 15);
DefaultLog::log()->set_filter(INFO_LOG, 15);
DefaultLog::log()->set_filter(DEBUG_LOG, 15);
> If we turn the threading down, to a single thread i.e access only one
> snmpv3 agent , the error never appears. It also seems to happen more
> often as we increase the number of threads i.e access more than one
> snmpv3 agent concurrently. Hence we are suspecting some form of a
> threading issue where the response PDU may be getting compromised.
Most likely. From another mail I just found a possible cause: the
generation of the v3 message id is not thread safe. See patch at end of
mail. If this patch does not help, you can send me the complete log
output with the error message. The important log messages should be
those with v3MP::Cache.
Regards,
Jochen
--------------------------
Index: include/snmp_pp/mp_v3.h
===================================================================
--- include/snmp_pp/mp_v3.h (Revision 318)
+++ include/snmp_pp/mp_v3.h (Arbeitskopie)
@@ -627,6 +627,7 @@
OctetStr own_engine_id_oct;
unsigned int cur_msg_id; ///< msgID to use for next message
+ SNMP_PP_MUTABLE SnmpSynchronized cur_msg_id_lock;
USM *usm; ///< the USM object used
Index: src/mp_v3.cpp
===================================================================
--- src/mp_v3.cpp (Revision 318)
+++ src/mp_v3.cpp (Arbeitskopie)
@@ -660,6 +660,9 @@
int result;
usm = new USM(engineBoots, snmpEngineID, this, &cur_msg_id, result);
+ if (cur_msg_id >= MAX_MPMSGID)
+ cur_msg_id = 1;
+
if ((!own_engine_id) || (!usm) || (result != SNMPv3_USM_OK))
{
construct_status = SNMPv3_MP_ERROR;
@@ -1323,10 +1326,12 @@
securityModel = SecurityModel_USM;
}
+ cur_msg_id_lock.lock();
msgID = cur_msg_id;
cur_msg_id++;
if (cur_msg_id >= MAX_MPMSGID)
cur_msg_id = 1;
+ cur_msg_id_lock.unlock();
#ifdef INVALID_MSGID
LOG_BEGIN(ERROR_LOG | 1);
More information about the AGENTPP
mailing list