On 08/19/2013 12:58 PM, zhuyj wrote:
Hi,

I run the following commands:

--snmpset -c NETMAN -v 2c 128.224.162.243 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.0.25 i 5 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'..' = INTEGER: createAndWait(5)

--snmpget -c NETMAN -v 2c 128.224.162.243 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.0.25 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'..' = No Such Instance currently exists at this OID

--snmpget --version
NET-SNMP version: 5.7.2
--snmpset --version
NET-SNMP version: 5.7.2

This is because paramName in struct targetParamTable_struct is NUL-terminated string. Now we modify it to counted-string. It can work now.

--snmpset -c NETMAN -v 2c 128.224.162.243 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.0.25 i 5 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'..' = INTEGER: createAndWait(5) --snmpget -c NETMAN -v 2c 128.224.162.243 SNMP-TARGET-MIB::snmpTargetParamsRowStatus.0.25 -Ofn
.1.3.6.1.6.3.12.1.3.1.7.0.25 = INTEGER: notReady(3)

Now I attached the patch in the attachment. Please check it.
Would you like to merge this patch into trunk?

Best Regards!
Zhuyj
Hi, All

If this patch is used in net-snmp-5.7.2, the following should be used, too. If not, snmp-trap could not work well.

Best Regards!
Zhu Yanjun
diff -urpN net-snmp-5.7.2/agent/mibgroup/notification/snmpNotifyTable.c net-snmp-5.7.2-new/agent/mibgroup/notification/snmpNotifyTable.c
--- net-snmp-5.7.2/agent/mibgroup/notification/snmpNotifyTable.c
+++ net-snmp-5.7.2-new/agent/mibgroup/notification/snmpNotifyTable.c
@@ -338,6 +338,7 @@ notifyTable_register_notifications(int m
     SNMP_FREE(ptr->tagList);
     ptr->tagList = strdup(buf);
     ptr->params = strdup(buf);
+    ptr->paramsLen = bufLen;
     ptr->storageType = ST_READONLY;
     ptr->rowStatus = RS_ACTIVE;
     ptr->sess = ss;
@@ -349,6 +350,7 @@ notifyTable_register_notifications(int m
      */
     pptr = snmpTargetParamTable_create();
     pptr->paramName = strdup(buf);
+    pptr->paramNameLen = bufLen;
     pptr->mpModel = ss->version;
     if (ss->version == SNMP_VERSION_3) {
         pptr->secModel = ss->securityModel;
------------------------------------------------------------------------------
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=60135031&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