Hi,
When a get request is sent to the agent under the following
conditions:
- The get contains multiple OIDs
- All the OIDs belong to the SA, so the request is
proxied
- One of the OIDs does not exist in the SA
The agent, instead of responding noSuchName with the errorIndex
field pointing to the inexistent OID, it is not responding at all so the
snmpget application is giving timeout error.
I was looking at the code and the error seems to be in the
proxy.c file in the function proxy_got_response(). When the SA responds,
the function goes to the case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE,
since it is an error and it is not a GETNEXT request it calls
netsnmp_set_request_error(cache->reqinfo, requests, pdu->errstat); This
function only marks as not delegated the first request in the request
list, leaving the other requests as delegated. Which causes that the
agent never respond to the snmpget application.
Also, this is causing a memory leak because all these delegated
requests are never removed from memory.
The proposed solution would be to replace the
netsnmp_set_request_error(cache->reqinfo, requests, pdu->errstat); line
by
{
/* Find the request in the position i, where i =
pdu->errindex */
/* and set this request to SNMP_NOSUCHINSTANCE.
*/
i = 1;
rtmp = requests;
while(NULL != rtmp)
{
if (pdu->errindex == i)
{
rtmp->requestvb->type = SNMP_NOSUCHINSTANCE;
rtmp->status = pdu->errstat;
}
else
{
rtmp->requestvb->type = SNMP_ERR_GENERR;
}
rtmp = rtmp->next;
i++;
}
/* Mark all request as not delegated. */
netsnmp_handler_mark_requests_as_delegated(requests,
REQUEST_IS_NOT_DELEGATED);
}
This solved the get request, but the same problem appears when a
set is done under the same conditions. We still didn't find the problem
with the set. I don't know where to start looking for fixing the set
request, Have someone any idea?
Thanks,
Pablo
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders