Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8179

ifIndex >= 2^31

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 17.1.0
    • Fix Version/s: 18.0.0
    • Component/s: Data Collection - SNMP
    • Security Level: Default (Default Security Scheme)
    • Labels:
    • Environment:
      Debian 8, Oracle JDK 8

      Description

      I am facing problems with a non-conformant SNMP agent: its IF-MIB::ifTable contains rows with ifIndex >= 2^31. The ifIndex has (according to the MIB) syntax Integer32 (1..2^31-1), however, this agent is quite a big device from Huawei (a GPON OLT) and I will hardly ever make them to comply with the MIB.

      I'd like to collect statistics even from these interfaces, but current OpenNMS code fails when collectd tries to traverse the ifTable: "String -100663296 could not be converted to a SnmpObjId. It has a negative for subId 0" @ org.opennms.netmgt.snmp.SnmpObjId.convertStringToInts(SnmpObjId.java:121).

      There are 2 problems:
      a) the caller passes string containing negative value,
      b) SnmpObjId will not work with OID parts >= 2^31 anyway (uses Java 32-bit signed int)

      The b) might be already considered a bug: the numbers in OID are unsigned 32-bit ints (see RFC2578, SMIv2, section 3.5).

      I will try to fix both problems. What should be the right way to support 32-bit unsigned ints in current Java? Do we already depend on Java 8, which introduces unsigned ops in Integer class? Or do I have to use longs?

        Attachments

          Activity

            People

            • Assignee:
              jeffg Jeff Gehlbach
              Reporter:
              milank Milan Krcmar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: