public class IpAddressBadLengthBugAware
extends org.snmp4j.smi.IpAddress
Author:
Jeff Gehlbach <jeffg@opennms.org>
This class was created to work around a bug in the Net-SNMP BER library
that causes Net-SNMP agents prior to version 5.4.1 on 64-bit platforms to
encode IPv4 addresses as 8 bytes rather than 4 bytes. SNMP4J correctly
discards these representations by default.
It has since been extended to substitute an IPv4 address of 0.0.0.0 when
presented with a zero-length IpAddress value. This behavior has been
seen from DrayTek Vigor2820 series routers.
This class will be used in place of org.snmp4j.smi.IpAddress only if we
call org.snmp4j.SNMP4JSettings.setExtensibilityEnabled(true) AND set the
system property org.snmp4j.smisyntaxes to refer to a classpath properties
resource (relative to class org.snmp4j.smi.AbstractVariable) that overrides
the default mapping for BER type 64 (nominally IpAddress). See the file
opennms-snmp4j-smisyntaxes.properties.
The workaround for 8-bit long IPv4 addresses will be enabled only if the
system property org.opennms.netmgt.snmp.workarounds.allow64BitIpAddress is
set to "true".
The workaround for 0-byte IPv4 addresses will be enabled only if the
system property org.opennms.snmp.workarounds.allowZeroLengthIpAddress is
set to "true".