I was bit recently by a design limitation on the length of OCTET STRINGS
as received and processed by AgentX.

My subagent was sending a Notify, that under certain conditions contained
'long' strings; and I was seeing that snmpd (once it received one of these
notifies) didn't forward that notify, and also ceased to forward all future
transactions
on
on
that agentx session (I think in either direction).

[I wasn't going to diagnose the stopping problem until I first determined
the
cause of the non-processing/non-forwarding
problem
.
]


Once I realized I needed to turn on selective debugging for agentx to see
the
related warning message ("String too long") I located the issue in
:

agent/mibgroup/agentx/protocol.c line 1249

where it tests the incoming string against the size of the temporary buffer
that will be used to hold the string.  That buffer is defined (at line 1553)
with a size of SNMP_MAX_MSG_SIZE (
at
the size of an Ethernet frame):

./include/net-snmp/library/snmp_api.h
#define SNMP_MAX_MSG_SIZE          1472 /* ethernet MTU minus IP/UDP header
*/

AgentX specs an octet string according to its 32 bit length,
but SMI limits it to a 16 bit length,
but others have noted that there may be implementation/inter-operability
issues at much shorter lengths.

So
,
should Net-SNMP have its own implementation limit, or would it be better
to set its limit to the s
mallest of the known specs (SMIv2 at 2^16 - 1) ?
... instead of its current limit ?

In the mean time, I have inserted
'
paranoia code
'
into my AgentX library to
truncate any octet string variable to net-snmp's limit, to avoid the lockup
I am experiencing.

Comments?

Fulko
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to