RE: Seems that I found bugs related to stash_cashe in 5.7...
"Ivo Faldini" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Bart, In continuation to my previous e-mail (attached below), I checked again stash_cache (after applying my tentative fixes) with one of my tables, and I've realized that get-next/get-bulk seems to work, but get snmp with more than 1 varbind doesn't work properly... Regards Ivo ________________________________ From: Ivo Faldini Sent: Tuesday, July 26, 2011 12:08 PM To: 'Bart Van Assche' Cc: [email protected]; Meir Katz Subject: RE: Seems that I found bugs related to stash_cashe in 5.7... Add to your snmpd.conf: injectHandler stash_cache nsModuleTable table_iterator try to execute snmpd with follow cmd line: snmpd -DinjectHandler,helper:stash_cache,initialize_table_nsModuleTable -c snmpd.conf You'll see no stash_cache prints at all!. The first and immediate fix is to: #define NETSNMP_FEATURE_HAS_STASH_CACHE In a place that all_helpers.c will see it After doing this you may try again and see the results, that seems to be the same as without inserting injectHandler stash_cache nsModuleTable table_iterator statement into snmpd.conf. I have no netsnmp5.6 in order to test this... I hope this will be enough for the test... If you apply the changes I advised you in my last mail, it seems to make things better... I saw that it works for nsModuleTable, but unfortunately for my proxy agent it crashed it (as sent by me also). My fixes were (in diff like mode) --- ./net-snmp-5.7.org/agent/helpers/stash_cache.c 2011-07-26 10:38:41.321250000 +0300 +++ ./net-snmp-5.7/agent/helpers/stash_cache.c 2011-07-26 11:59:19.727500000 +0300 @@ -137,7 +137,9 @@ DEBUGMSGTL(("helper:stash_cache", "Got request\n")); - cache = netsnmp_cache_reqinfo_extract( reqinfo, reginfo->handlerName ); + char addrstr[32]; + snprintf(addrstr,sizeof(addrstr), "%ld", (long int)handler->prev->myvoid); + cache = netsnmp_cache_reqinfo_extract( reqinfo, addrstr ); if (!cache) { DEBUGMSGTL(("helper:stash_cache", "No cache structure\n")); return SNMP_ERR_GENERR; --- ./net-snmp-5.7.org/agent/agent_handler.c 2011-07-26 10:38:41.118125000 +0300 +++ ./net-snmp-5.7/agent/agent_handler.c 2011-07-26 11:59:19.680625000 +0300 @@ -1173,15 +1173,15 @@ if (strcmp(tptr->label_a, name) == 0) { DEBUGMSGTL(("injectHandler", "injecting handler %s into %s\n", handler->handler_name, tptr->label_a)); - netsnmp_inject_handler_before(tptr->reginfo, _clone_handler(handler), - before_what); + netsnmp_inject_handler_before(tptr->reginfo, netsnmp_handler_dup(handler), + before_what); } else if (tptr->reginfo != NULL && tptr->reginfo->handlerName != NULL && strcmp(tptr->reginfo->handlerName, name) == 0) { DEBUGMSGTL(("injectHandler", "injecting handler into %s/%s\n", tptr->label_a, tptr->reginfo->handlerName)); - netsnmp_inject_handler_before(tptr->reginfo, _clone_handler(handler), - before_what); + netsnmp_inject_handler_before(tptr->reginfo, netsnmp_handler_dup(handler), + before_what); } else { for (mh = tptr->reginfo->handler; mh != NULL; mh = mh->next) { if (mh->handler_name && strcmp(mh->handler_name, name) == 0) { ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Bart Van Assche Sent: Tuesday, July 26, 2011 8:51 AM To: Ivo Faldini Cc: [email protected]; Meir Katz Subject: Re: Seems that I found bugs related to stash_cashe in 5.7... On Thu, Jul 21, 2011 at 11:23 AM, Ivo Faldini <[email protected]> wrote: I'll be very brief. I'm a newbie in NET-SNMP, so I'm informing you about problematic issues I found in the package that it may be bugs): injectHandler stash_cache TABLE table_iterator doesn't work at all in 5.7. It would help if you could post source code of a minimal example that works with 5.6 but not with 5.7. Bart. NOTICE: This email and any files transmitted with it are Enablence and Teledata-Networks confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains Enablence and Teledata-Networks confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. ------------------------------------------------------------------------------ Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ _______________________________________________ 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