Hi Wes/Parsons,
Thank you very much for your quick response.
Yes, it is very odd. Fortunately, there are some tables which still work after
upgrading from net-snmp 5.4.2 to 5.7.2.1. by comparing the bad one (ntpTable)
with one of my good ones (userTable) I noticed the differences in the code for
MODE_GET. Refer to the code in the end of this email.
Using the good one as a reference and modified the bad one it worked! But it's
still a myth to me why different version has different behavior. How should I
code better to avoid this happen again going forward when upgrading to the
newer version?
Thanks,
Gefei Jiang
The code differences:
####### for the bad one (from ntpTable)
##################################################################
/* Read-support (also covers GetNext requests) */
case MODE_GET:
for (request = requests; request; request = request->next)
{
if ((table_entry = (ntpTable_entry *)
netsnmp_extract_iterator_context (request)) == NULL ||
(table_info = netsnmp_extract_table_info (request)) == NULL)
{
netsnmp_set_request_error (reqinfo, request,
SNMP_NOSUCHINSTANCE);
return SNMP_NOSUCHINSTANCE; /* <-- the difference */
}
switch (table_info->colnum)
{
....
}
####### for the good one (from userTable
##################################################################
/* Read-support (also covers GetNext requests) */
case MODE_GET:
for (request = requests; request; request = request->next)
{
if ((table_entry = (ntpTable_entry *)
netsnmp_extract_iterator_context (request)) == NULL)
{
netsnmp_set_request_error (reqinfo, request,
SNMP_NOSUCHINSTANCE);
continue; /* <-- the difference */
} else
switch (table_info->colnum)
{
....
}
###########################################################################################
PS: sorry I didn't get a chance to use the debug flag to get a capture since my
code has been changed
###########################################################################################
-----Original Message-----
From: Wes Hardaker [mailto:[email protected]]
Sent: Thursday, April 17, 2014 6:40 AM
To: Gefei Jiang
Cc: [email protected]
Subject: Re: Error in packet. Reason: Unknown Error with snmpwalk
Gefei Jiang <[email protected]> writes:
> When I do snmpwalk on one of my table (ntpTable) it displays
Very odd. Can you run snmpwalk with both -d and -Ddump and send us that output?
--
Wes Hardaker
Parsons
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
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