[AGENT++] Why is it possible to destroy an non existing row?

Frank Fock fock at agentpp.com
Wed Jun 19 00:04:10 CEST 2013


Hi Claus,

The SNMP RFCs require that a request setting the status of a non-existing
row to destroy(6) should return no error. It is left to the implementation
how this goal is achieved.

I improved the behavior for this use case with AGENT++ 4.0 and AgentX++ 2.0.
May be that helps?

Best regards,
Frank

Am 18.06.2013 23:10, schrieb Claus Klein:
> Hi,
>
> I can't understand why it should possible to delete a non existing row?
>
> I have added this code to prevent this strange behavior:
>
> int netSnmpHostsEntry::is_transition_ok(MibTable* table, MibTableRow* row, const Oidx& index,
>                                          int currentStatus, int requestedStatus) {
>      // The row 'row' with 'index' from 'table' (which will be 0 for local table)
>      // is requested to change status. Accept or deny this state change here.
>      //--AgentGen BEGIN=netSnmpHostsEntry::is_transition_ok
>
>      if ((currentStatus == rowEmpty) && (requestedStatus == rowDestroy)) {
>          std::cerr << BOOST_CURRENT_FUNCTION  << "(" << currentStatus << " -> "
>                    << requestedStatus << ") This is not allowed!" << std::endl;
>          return SNMP_ERROR_INCONSIST_VAL;
>      }
> ...
> }
>
>
> Without this check the following happens:
>
> Claus-Kleins-MacBook-Pro:agentproI12 clausklein$ snmptable -Cib -r0 -t10 localhost hoststable
> SNMP table: NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable
>
>              index AddressType                                            Address     Storage RowStatus
>       \"loopback\"        ipv6 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile    active
>      \"localhost\"        ipv4                                     "7F 00 00 01 " nonVolatile    active
> \"broadcasthost\"        ipv4                                     "FF FF FF FF " nonVolatile    active
>
> Claus-Kleins-MacBook-Pro:agentproI12 clausklein$ snmpset localhost netSnmpHostRowStatus.\"test\" = destroy
> NET-SNMP-EXAMPLES-MIB::netSnmpHostRowStatus.\"test\" = INTEGER: destroy(6)
>
> Claus-Kleins-MacBook-Pro:agentproI12 clausklein$ snmptable -Cib -r0 -t10 localhost hoststable
> SNMP table: NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable
>
>              index AddressType                                            Address     Storage RowStatus
>       \"loopback\"        ipv6 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile    active
>      \"localhost\"        ipv4                                     "7F 00 00 01 " nonVolatile    active
> \"broadcasthost\"        ipv4                                     "FF FF FF FF " nonVolatile    active
>           \"test\"           ?                                                  ? nonVolatile   destroy
>
> Claus-Kleins-MacBook-Pro:agentproI12 clausklein$ snmpset localhost netSnmpHostRowStatus.\"test\" = destroy
> Error in packet.
> Reason: inconsistentValue (The set value is illegal or unsupported in some way)
> Failed object: NET-SNMP-EXAMPLES-MIB::netSnmpHostRowStatus.\"test\"
>
> Claus-Kleins-MacBook-Pro:agentproI12 clausklein$
>
>
> ... and the index is blocked with RowStatus "destroy" forever.
>
> Tested with shared and non shared Tables; current net-snmp as agentX master and
>
> agent++v3.5.31
> agentX++v1.4.18a
> libdes-l-4.01a
> snmp++v3.2.25
>
> as agentX subagent.
>
>
> //Regards
> Claus
>
>
>
>
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231



More information about the AGENTPP mailing list