Description: snmpd: recover SET status from delegated request
 Reported by: Yu Zhang of VARAS@IIE, Nanyu Zhong of VARAS@IIE
 Fixes by: Arista Networks
 .
 When a SET request includes a mix of delegated and
 non-delegated requests (e.g., objects handled by master
 agent and agentx sub-agent), the status can get lost while
 waiting for the reply from the sub-agent.  Recover the status
 into the session from the requests even if it has already
 been processed.
 .
 CVE-2022-24806 CVE-2022-24807 CVE-2022-24808 CVE-2022-24810 
Author: Bill Fenner <fenner@gmail.com>
Origin: upstream, https://github.com/net-snmp/net-snmp/commit/9a0cd7c00947d5e1c6ceb54558d454f87c3b8341
Bug-Debian: https://bugs.debian.org/1016139
Applied-Upstream: 5.9.3
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2022-08-10 <YYYY-MM-DD, last update of the meta-information, optional>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/agent/snmp_agent.c
+++ b/agent/snmp_agent.c
@@ -2965,7 +2965,7 @@
         if (requests->status != SNMP_ERR_NOERROR &&
             (!look_for_specific || requests->status == look_for_specific)
             && (look_for_specific || asp->index == 0
-                || requests->index < asp->index)) {
+                || requests->index <= asp->index)) {
             asp->index = requests->index;
             asp->status = requests->status;
         }
