Description of problem: When the snmpvacm command with createView for UCD-SNMP-MIB::memory is executed, inconsistentName error occurred. # snmpvacm localhost -u readwrite -a MD5 -A authsecret -x DES -X privsecret -l authPriv createView vmini UCD-SNMP-MIB::memory Error in packet. Reason: inconsistentName (That object can not currently be created) Failed object: SNMP-VIEW-BASED-ACM-MIB::vacmViewTreeFamilyStatus."vmini".8.1.3.6.1.4.1.2021.4 Version-Release number of selected component (if applicable): rhel 5.4 net-snmp-5.3.2.2-7.el5 How reproducible: always Steps to Reproduce: 1. /etc/snmp/snmpd.conf view vall included .1 group RWGroup usm readwrite access RWGroup "" any priv exact vall vall none 2. /var/net-snmp/snmpd.conf createUser readwrite MD5 authsecret DES privsecret 3. # service snmpd restart 4. # snmpvacm localhost -u readwrite -a MD5 -A authsecret -x DES -X privsecret -l authPriv createView vmini UCD-SNMP-MIB::memory Actual results: Error in packet. Reason: inconsistentName (That object can not currently be created) Failed object: SNMP-VIEW-BASED-ACM-MIB::vacmViewTreeFamilyStatus."vmini".8.1.3.6.1.4.1.2021.4 Expected results: View successfully created. Additional info: # snmptranslate -On UCD-SNMP-MIB::memory .1.3.6.1.4.1.2021.4 When there is the number greater than 255 in the oid, it seems that view_parse_oid() returns SNMP_ERR_INCONSISTENTNAME. ------------------------ view_parse_oid(oid * oidIndex, size_t oidLen, unsigned char **viewName, size_t * viewNameLen, oid ** subtree, size_t * subtreeLen) ... for (i = 0; i < subtreeL; i++) { if (oidIndex[i + viewNameL + 1] > 255) { free(*viewName); free(*subtree); return SNMP_ERR_INCONSISTENTNAME; <<=== Here!! } subtree[0][i] = (oid) oidIndex[i + viewNameL + 1]; } In this case, 2021 is greater than 255. So, view_parse_oid() returns SNMP_ERR_INCONSISTENTNAME, and this problem occurs. Then, according to /usr/share/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.txt, ================================================== -- Support for instance-level granularity is optional. -- -- In some implementations, instance-level access control -- granularity may come at a high performance cost. Managers -- should avoid requesting such configurations unnecessarily. ... vacmViewTreeFamilyEntry OBJECT-TYPE SYNTAX VacmViewTreeFamilyEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Information on a particular family of view subtrees included in or excluded from a particular SNMP context's MIB view. ... If a create for an entry for instance-level access control is received and the implementation does not support instance-level granularity, then an inconsistentName error must be returned. ==================================================== not sure if this information is helpful.
Thanks for detailed break-down, you pointed me directly to the correct place. The following check is really strange: if (oidIndex[i + viewNameL + 1] > 255) SVN log does not show anything useful, commit message contains "Bail out for bad snmpAdminString value" and I don't see any adminString around...
I have just checked in fix upstream, SVN rev. 17791.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0253.html