From: SourceForge.net <no...@so...> - 2010-03-22 19:48:49
|
Bugs item #2974800, was opened at 2010-03-22 20:48 Message generated for change (Tracker Item Submitted) made by crovisa You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=2974800&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: agent Group: linux Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jordi Lopez (crovisa) Assigned to: Nobody/Anonymous (nobody) Summary: table helper sends request to handler with index = 0 Initial Comment: I've generated an Agent-X sub-agent that creates a table using the tdata helper. The code was generated using mib2c and has been minimally modified to add functionality. Everything worked fine until I tried to test the sub-agent using my customer client. It seems that, somehow, my table handler is receiving SET requests with the index set to value 0. As far as I know SNMP indexes always start at 1. Looking at the SNMP message trace the client was indeed requesting a SET on index 0. Admittedly my customer program is buggy because it should never send a request to index 0 but, shouldn't the table helper check this problem and issue an out of range error. This is a extract of the log with the helper:table messages switched on. The last line is my handler complaining about a 0 index. helper:table:req: Got request for handler table: base oid:SNMPv2-SMI::enterprises.1206.4.2.3.10.6 helper:table:req: Got request for handler table: base oid:SNMPv2-SMI::enterprises.1206.4.2.3.10.6 SNMPv2-SMI::enterprises.1206.4.2.3.10.6.1.4.0 helper:table:set: SET_REQUEST for OID: SNMPv2-SMI::enterprises.1206.4.2.3.10.6.1.4.0 type=2(02), value=INTEGER: 0 helper:table:col: have at least a column (4) helper:table: have 1 bytes of index helper:table: looking for 1 indexes helper:table: got 1 (incomplete=0) helper:table:results: found 1 indexes helper:table:results: column: 4, indexes: 1 index: type=2(02), value=INTEGER: 0 ntcip: dmsGraphicTableHandler called req = SET col = 4 index = 0 This causes netsnmp_tdata_extract_entry to return a NULL pointer and generates a SEGFAULT in MODE_SET_ACTION when the programs tries to acces the entry fields. The problem with the Index should have been detected in RESERVE1 or in the table helper itself. There are a lot of workarounds for this problem, not really a big one, but I think I should report it. Maybe I'm missing something and I'm simply doing things wrong. I'm using NET-SNMP 5.4.1 on an Ubuntu 9.04 machine, kernel 2.6.28-18 Thank you for your attention. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=2974800&group_id=12694 |