On ons, 2007-01-24 at 16:24 +0000, Dave Shield wrote: > On 22/01/07, Dave Shield <[EMAIL PROTECTED]> wrote: > > On 21/01/07, Magnus Fromreide <[EMAIL PROTECTED]> wrote: > > > The current net-snmp handling of [a short trap OID] seems > > > to be SIGSEGV, so I suppose something have to be done. > > > > Crashing out is not a good idea, no! > > At the very least, I'd be inclined to log an error and discard the trap. > > I'm attaching a patch that's intended to address this problem. > > The reason I'm not committing it to the CVS tree is that there seems > to be something strange happening with the 'vblist->var_len' field. > Tests run this morning on my laptop seemed to indicate that this > contained the number of subidentifiers in the OID value, rather than > the size of this value. > But the line: > len = vblist->var_len/sizeof(oid); > clearly expects this to be the size of the raw data (which is > how it's used elsewhere). > > I must have been tempting fate with my comments yesterday about the > effects of ten years plus working on this code. Can someone please > test this patch, and confirm whether or not it works correctly. Both with > "invalidly-short" trap OIDs (i.e. two subidentifiers) AND "short but valid" > trap OIDs (e.g. four or five subidentifiers).
I have tested it with 3 subidentifiers, it successfully sends the trap. I have tested it with 2 subidentifiers, it fails - but not as expected, it blocks the transmission of the v2 trap as well since the check on agent/agent_trap.c:734 terminates all sending attempts. Annoyingly it is not as simple as just removing the test since the code further down assumes that there is a v1pdu available. Oh yes, this also affects the ability to forward v2 pdu's that contains counter64 variables. /MF ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
