Subject: | Invalid IpAddress length (8 bytes) against 64bit net-snmpd |
Example: performing a get_request for oid: .1.3.6.1.2.1.4.21.1.7.0.0.0.0
will result in an error if performed against a net-snmpd server <4.0:
"request error: Invalid IpAddress length (8 bytes)"
net-snmp versions <5.4 have a bug where IpAddress is 8 bytes instead of
4 on 64bit hosts:
http://www.net-snmp.org/about/ChangeLog.html -
5.4:
snmpd:
- fix 8 byte IpAddress in at, ip and route MIBs.
So, what I did was patch Net::SNMP so it works against both good and
"bad" 64bit net-snmp servers.
A patch is attached which works around the issue.
Subject: | libnet-snmp-perl-8byte.patch |
--- Message.pm.dpkg-orig 2009-01-16 13:04:28.627374174 +0100
+++ Message.pm 2009-01-16 13:07:39.412626749 +0100
@@ -1456,15 +1456,15 @@
# Decode the length
return $this->_error unless defined(my $length = $this->_process_length);
-
- if ($length != 4) {
+ # snmpd <4.0 has an 8 byte IpAddress on 64bit systems //Fridh
+ if ($length != 4 && $length != 8) {
return $this->_error(
'Invalid IpAddress length (%d byte%s)',
$length, ($length != 1 ? 's' : '')
);
}
- if (defined(my $ip = $this->_buffer_get(4))) {
+ if (defined(my $ip = $this->_buffer_get($length))) {
sprintf('%vd', $ip);
} else {
$this->_error;