# HG changeset patch # User Michael Schloh von Bennewitz # Date 1316615286 -7200 # Node ID 590d931d793c2c7790e5c54fb231121e4f3912fb # Parent ff9d497ea16d2d5b72c2f003dd977342460d086f Try to fix horrible SIGSEGV frequent crashes by patching snmp_agentx logic. diff -r ff9d497ea16d -r 590d931d793c snmp/snmp.spec --- a/snmp/snmp.spec Wed Sep 21 16:27:30 2011 +0200 +++ b/snmp/snmp.spec Wed Sep 21 16:28:06 2011 +0200 @@ -32,7 +32,7 @@ Group: Network License: BSD Version: 5.7 -Release: 20110914 +Release: 20110915 # package options %option with_fsl yes @@ -50,6 +50,7 @@ Source3: snmpd.conf Source4: snmptrapd.conf Patch0: snmp.patch +Patch1: snmp_agentx.patch # build information Prefix: %{l_prefix} @@ -87,6 +88,7 @@ # unpack and patch package %setup -q -n net-snmp-%{version} %patch -p0 + %patch -p0 -P 1 # provide a default PID file location %{l_shtool} subst %{l_value -s -a} \ diff -r ff9d497ea16d -r 590d931d793c snmp/snmp_agentx.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/snmp/snmp_agentx.patch Wed Sep 21 16:28:06 2011 +0200 @@ -0,0 +1,74 @@ +diff Nau agent/snmp_agent.c.orig agent/snmp_agent.c +Index: agent/snmp_agent.c +--- agent/snmp_agent.c.orig ++++ agent/snmp_agent.c +@@ -1535,38 +1535,42 @@ int + netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess) + { + netsnmp_agent_session *asp; +- int count = 0; +- +- for (asp = agent_delegated_list; asp; asp = asp->next) { +- /* +- * check each request +- */ +- netsnmp_request_info *request; +- for(request = asp->requests; request; request = request->next) { +- /* +- * check session +- */ +- netsnmp_assert(NULL!=request->subtree); +- if(request->subtree->session != sess) +- continue; ++ int count; + ++ do { ++ count = 0; ++ for (asp = agent_delegated_list; asp; asp = asp->next) { + /* +- * matched! mark request as done ++ * check each request + */ +- netsnmp_request_set_error(request, SNMP_ERR_GENERR); +- ++count; ++ netsnmp_request_info *request; ++ for(request = asp->requests; request; request = request->next) { ++ /* ++ * check session ++ */ ++ netsnmp_assert(NULL!=request->subtree); ++ if(request->subtree->session != sess) ++ continue; ++ ++ /* ++ * matched! mark request as done ++ */ ++ netsnmp_request_set_error(request, SNMP_ERR_GENERR); ++ ++count; ++ } + } +- } + +- /* +- * if we found any, that request may be finished now +- */ +- if(count) { +- DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session " +- "%8p\n", count, sess)); +- netsnmp_check_outstanding_agent_requests(); +- } +- ++ /* ++ * if we found any, that request may be finished now ++ */ ++ if(count) { ++ DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session " ++ "%8p\n", count, sess)); ++ netsnmp_check_outstanding_agent_requests(); ++ /* the request may get delegated if it was GETNEXT, retry the loop */ ++ } ++ } while (count); ++ + return count; + } +