Blame SOURCES/net-snmp-5.5-getnext-loop.patch

8a419f
851637 - snmpd loops inifinitely after receiving SIGTERM
8a419f
8a419f
commit 9b15aa36d0fc40b46fe9461d56cf584bbf040691
8a419f
Author: Jan Safranek <jsafranek@users.sourceforge.net>
8a419f
Date:   Thu Sep 13 15:25:52 2012 +0200
8a419f
8a419f
    CHANGES: snmpd: fixed infinite loop when SIGTEM arrives in middle of internal query processing.
8a419f
    
8a419f
    When snmpd starts internal query, e.g. for 'monitor' config options, it calls
8a419f
    netsnmp_query_walk(). This function loops until either error occurs or the
8a419f
    internal request is processed. And if SIGTERM comes to this loop, the request
8a419f
    is not marked as failed.
8a419f
    
8a419f
    Patch originally from Masahiro Matsuya, mmatsuya [at] redhat.com
8a419f
8a419f
diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c
8a419f
index 1c00a4c..b7761b0 100644
8a419f
--- a/agent/snmp_agent.c
8a419f
+++ b/agent/snmp_agent.c
8a419f
@@ -3057,6 +3057,9 @@ handle_getnext_loop(netsnmp_agent_session *asp)
8a419f
             return status;      /* should never really happen */
8a419f
         }
8a419f
     }
8a419f
+    if (!netsnmp_running) {
8a419f
+        return SNMP_ERR_GENERR;
8a419f
+    }
8a419f
     return SNMP_ERR_NOERROR;
8a419f
 }
8a419f