Re: Net-snmp master agentx not speaking the same protocol as a perl subagent?

"Brice Figureau" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi again,

I found the issue, see below:

On Sun, July 20, 2008 18:18, Brice Figureau wrote:
> [snipped the whole trace]
> trace: agentx_parse_oid(): mibgroup/agentx/protocol.c, 1205:
> dumpv_recv:           OID: SNMPv2-SMI::enterprises.20267.200.1.6.0
> dumpx_recv:          00 00 00 00
> dumpv_recv:            Integer:	0 (0x00)
> dumpx_recv:          E8 83 84 B8
> dumpv_recv:            Integer:	3095692264 (0xB88483E8)
> trace: agentx_parse_varbind(): mibgroup/agentx/protocol.c, 1344:
> dumph_recv:         VarBind:
> trace: agentx_parse_varbind(): mibgroup/agentx/protocol.c, 1345:

agentx_parse_varbind was increasing the buffer pointer of 2 * sizeof(long)
after decoding a counter64. This is incorrect since on amd64 sizeof(long)
is 8 bytes and not 4 bytes. It was just then jumping over the next
varbind.

I attached a patch to fix this issue, which I'll also register on
sourceforge.

-- 
Brice Figureau

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
fix-qgentx-protocol-for-64bit.patch (application/octet-stream, 333 B)
--- agent/mibgroup/agentx/protocol.c.orig	2008-07-20 18:42:16.000000000 +0200
+++ agent/mibgroup/agentx/protocol.c	2008-07-20 18:43:17.000000000 +0200
@@ -1411,7 +1411,7 @@
 
         memcpy(data_buf, &tmp64, sizeof(tmp64));
 	*data_len = sizeof(tmp64);
-	bufp += 2 * sizeof(long);
+	bufp += 2 * 4;
 	*length -= 8;
         break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.