On Mon, 29 Nov 2004 17:35:04 -0500 Gillis, wrote:
GPW> In 5.2.1, on Win2K Pro,

I assume you mean 5.1.2, since there is not 5.2.1.

GPW> I have an agent with code generated from mib2c 
GPW> with  create-dataset. I can run snmpset with 1 PDU fine, as far as I can
GPW> tell. But if I run it with multiple PDU's on a table with no rows, the
GPW> first time through it creates a row and sets the values fine.  But the
GPW> second time, I get an error: "Unhandled exception in snmpd.exe:
GPW> 0xC0000005: Access Violation". Same thing happens if I create the rows in
GPW> code.

Can you try this patch?

Index: agent/helpers/table_dataset.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/helpers/table_dataset.c,v
retrieving revision 5.19.2.3
retrieving revision 5.19.2.4
diff -u -r5.19.2.3 -r5.19.2.4
--- agent/helpers/table_dataset.c       7 Apr 2004 14:57:30 -0000      
5.19.2.3+++ agent/helpers/table_dataset.c       21 Oct 2004 18:46:01 -0000     
5.19.2.4@@ -451,6 +451,10 @@
             (reginfo->rootoid_len + 2);

         if (MODE_IS_SET(reqinfo->mode)) {
+            char buf[256]; /* is this reasonable size?? */
+            int  rc;
+            size_t len;
+
             /*
              * use a cached copy of the row for modification
              */
@@ -459,9 +463,27 @@
              * cache location: may have been created already by other
              * SET requests in the same master request.
              */
+            rc = snprintf(buf, sizeof(buf), "dataset_row_stash:%s:",
+                          datatable->table->name);
+            if ((-1 == rc) || (rc >= sizeof(buf))) {
+                snmp_log(LOG_ERR,"%s handler name too long\n",
+                         datatable->table->name);
+                netsnmp_set_request_error(reqinfo, request,
+                                          SNMP_ERR_GENERR);
+                continue;
+            }
+            len = sizeof(buf) - rc;
+            rc = snprint_objid(&buf[rc], len, table_info->index_oid,
+                               table_info->index_oid_len);
+            if (-1 == rc) {
+                snmp_log(LOG_ERR,"%s oid or name too long\n",
+                         datatable->table->name);
+                netsnmp_set_request_error(reqinfo, request,
+                                          SNMP_ERR_GENERR);
+                continue;
+            }
             stashp = (netsnmp_oid_stash_node **)
-                netsnmp_table_get_or_create_row_stash(reqinfo,
-                                                      "dataset_row_stash");
+                netsnmp_table_get_or_create_row_stash(reqinfo, buf);

             newrowstash
                 = netsnmp_oid_stash_get_data(*stashp, suffix, suffix_len);

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to