There seems to be something wrong in
netsnmp_table_helper_add_indexes
(agent\helpers\table.c) The call to va_arg extracts
items of type int, but ASN_INTEGER is defined as
u_char. Shouldn't:
((type = va_arg(debugargs, int)
be
((type = va_arg(debugargs, u_char)
Here are snippets that I have taken from the source to
make reviewing the problem easier. Please let me know
if I am missing something or if I should submit a
patch.
Robert Wilcox
void
#if HAVE_STDARG_H
netsnmp_table_helper_add_indexes(netsnmp_table_registration_info
*tinfo,
...)
#else
netsnmp_table_helper_add_indexes(va_alist)
va_dcl
#endif
{
va_list debugargs;
int type;
#if HAVE_STDARG_H
va_start(debugargs, tinfo);
#else
netsnmp_table_registration_info *tinfo;
va_start(debugargs);
tinfo = va_arg(debugargs,
netsnmp_table_registration_info *);
#endif
while ((type = va_arg(debugargs, int)<- SHOULDN'T
THIS BE U_CHAR? ) != 0) {
netsnmp_table_helper_add_index(tinfo, type);
}
va_end(debugargs);
}
Example usage:
void
Some_function(){
netsnmp_table_registration_info *table_info;
.
.
.
.
netsnmp_table_helper_add_indexes(table_info,ASN_INTEGER,ASN_INTEGER,
0);
.
.
.
}
#define ASN_INTEGER ((u_char)0x02)
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders