]> git.puffer.fish Git - matthieu/frr.git/commit
[smux] 64-bit fix for lib/smux.h SNMP_INTEGER() macro
authorChris Caputo <ccaputo@alt.net>
Tue, 2 Jun 2009 17:37:11 +0000 (18:37 +0100)
committerPaul Jakma <paul@quagga.net>
Tue, 2 Jun 2009 17:38:24 +0000 (18:38 +0100)
commit42176e6b01c9ca2b2725952684b2d7792468e861
tree2eb360778e96efe5ddc554a2b348e5e743030d61
parent04d23314ddf950fefb3ff18306c7564bf4573a12
[smux] 64-bit fix for lib/smux.h SNMP_INTEGER() macro

Macro SNMP_INTEGER() prepares data which is eventually processed
by asn_build_int().  SNMP_INTEGER() was using "int32_t" whereas
asn_build_int() uses "long".  On 32-bit systems these are the
same, both 4 bytes, but on x86 64-bit systems "long" is 8 bytes.

asn_build_int()'s reaction to an improperly sized value is to return
a NULL pointer.  Quagga's smux.c would eventually get this NULL
pointer and use it in calculations to determine how much data to send
over the smux connection, resulting in garbage being sent to the
SNMP agent.

Corrected SNMP_INTEGER() to use "long".

Tested on 32-bit and 64-bit x86 Linux 2.6.27.10 systems running
Quagga 0.99.11 with bgpd smux.
lib/smux.h