[quagga-dev 6304] Re: [PATCH] 64-bit fix for lib/smux.h SNMP_INTEGER () macro
Kirill K. Smirnov
lich at math.spbu.ru
Mon Dec 22 17:42:17 GMT 2008
> On Mon, 2008-12-22 at 18:13 +0300, Kirill K. Smirnov wrote:
> > I've just looked into net-snmp sources&docs, but I cannot find the exact
> > semantic of asn_build_int() function. Should it convert a 'long' integer
> > or 32-bit integer to BER format? I dunno... If 'long', then your patch is
> > correct, otherwise net-snmp is buggy.
> If the value goes over the wire in SNMP protocol, shouldn't the protocol
> specify the exact size?
Protocol itself contains length of encoded integer - it can be 1, 2 or 4. The
variable to be encoded always belongs to 'long' type. The resulting size
depends solely on value itself.
The problem is that function uses type 'long' and being called with variable
of int_32 type.
More information about the Quagga-dev