From d36c9222cdf411595cf377bcde6308adc4c30117 Mon Sep 17 00:00:00 2001 From: Net-SNMP Packaging Team Date: Mon, 27 Jun 2022 15:01:26 +0800 Subject: [PATCH] Fix engineID reprobe Do not probe for engineID when we already know it Reviewed-by: Craig Small Last-Updated: 2019-02-07 Gbp-Pq: Name fix_engineid_reprobe.diff --- snmplib/snmpusm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snmplib/snmpusm.c b/snmplib/snmpusm.c index 3cfa126..e697c23 100644 --- a/snmplib/snmpusm.c +++ b/snmplib/snmpusm.c @@ -3258,6 +3258,11 @@ int usm_discover_engineid(void *slpv, netsnmp_session *session) { int status, i; struct session_list *slp = (struct session_list *) slpv; + if (slp->session->securityEngineIDLen != 0) { + DEBUGMSGTL(("snmp_api", "engineID already known, skipping probe\n")); + return SNMPERR_SUCCESS; + } + if (usm_build_probe_pdu(&pdu) != 0) { DEBUGMSGTL(("snmp_api", "unable to create probe PDU\n")); return SNMP_ERR_GENERR;