[AGENT++] illegal value at RowStatus after commitFailed

Claus Klein claus.klein at arcormail.de
Wed Apr 8 23:20:40 CEST 2015


Hi all,

I found a problem with the table RowStatus and snmpRowStatus::unset():

Claus-MBP:AgentPro clausklein$ snmpset -r0 -t10 -v3 -u unsecureUser -n subagent localhost:4700 'netSnmpHostRowStatus."test2"' = createAndGo \
    'netSnmpHostAddressType."test2"' = ipv4 'netSnmpHostAddress."test2"' x 7F000002  netSnmpExampleInteger.0 = 1
Error in packet.
Reason: commitFailed
Failed object: NET-SNMP-EXAMPLES-MIB::netSnmpExampleInteger.0

Claus-MBP:AgentPro clausklein$ snmptable -Cib -r0 -t10 -v3 -u unsecureUser -n subagent localhost:4700 netSnmpHostsTable
SNMP table: NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable

            index AddressType                                            Address     Storage RowStatus
        \"nmsv6\"        ipv6 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile    active
        \"test2\"     unknown                                                 "" nonVolatile         0
    \"localhost\"        ipv6 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile    active
\"broadcasthost\"        ipv4                                     "FF FF FF FF " nonVolatile    active
Claus-MBP:AgentPro clausklein$ 

The undo ptr is NULL in this case and the row left in an illegal state?
By the way, older versions of agent++ lib use this NULL pointer and crash!

Is this a BUG or a feature?

Should the code be like this:
diff --git a/agent++/src/mib.cpp b/agent++/src/mib.cpp
index 5d41353..64b57be 100644
--- a/agent++/src/mib.cpp
+++ b/agent++/src/mib.cpp
@@ -668,8 +668,9 @@ int snmpRowStatus::unset()
                value = undo;
                undo = 0;
        }
+       return SNMP_ERROR_SUCCESS;
   }
-  return SNMP_ERROR_SUCCESS;
+  return SNMP_ERROR_UNDO_FAIL;
 }
 
 /**

Best regards
Claus


More information about the AGENTPP mailing list