293ae3
diff -up net-snmp-5.7.2/snmplib/snmp_api.c.original net-snmp-5.7.2/snmplib/snmp_api.c
293ae3
--- net-snmp-5.7.2/snmplib/snmp_api.c.original	2018-01-12 17:46:47.534166712 +0900
293ae3
+++ net-snmp-5.7.2/snmplib/snmp_api.c	2018-01-12 17:48:09.420911255 +0900
293ae3
@@ -4974,6 +4974,9 @@ _sess_async_send(void *sessp,
293ae3
 
293ae3
     reqid = pdu->reqid;
293ae3
 
293ae3
+    if (0 == reqid && (SNMPERR_SUCCESS == session->s_snmp_errno))
293ae3
+        ++reqid;
293ae3
+
293ae3
     /*
293ae3
      * Add to pending requests list if we expect a response.  
293ae3
      */
293ae3
diff -up net-snmp-5.7.2/snmplib/snmp_client.c.original net-snmp-5.7.2/snmplib/snmp_client.c
293ae3
--- net-snmp-5.7.2/snmplib/snmp_client.c.original	2018-01-12 17:48:21.814721234 +0900
293ae3
+++ net-snmp-5.7.2/snmplib/snmp_client.c	2018-01-12 18:33:55.779642445 +0900
293ae3
@@ -1044,11 +1044,13 @@ snmp_synch_response_cb(netsnmp_session *
293ae3
     ss->callback = pcb;
293ae3
     ss->callback_magic = (void *) state;
293ae3
 
293ae3
-    if ((state->reqid = snmp_send(ss, pdu)) == 0) {
293ae3
+    if (snmp_send(ss, pdu) == 0) {
293ae3
         snmp_free_pdu(pdu);
293ae3
         state->status = STAT_ERROR;
293ae3
-    } else
293ae3
+    } else {
293ae3
+        state->reqid = pdu->reqid;
293ae3
         state->waiting = 1;
293ae3
+    }
293ae3
 
293ae3
     while (state->waiting) {
293ae3
         numfds = 0;
293ae3
@@ -1136,11 +1138,13 @@ snmp_sess_synch_response(void *sessp,
293ae3
     ss->callback = snmp_synch_input;
293ae3
     ss->callback_magic = (void *) state;
293ae3
 
293ae3
-    if ((state->reqid = snmp_sess_send(sessp, pdu)) == 0) {
293ae3
+    if (snmp_sess_send(sessp, pdu) == 0) {
293ae3
         snmp_free_pdu(pdu);
293ae3
         state->status = STAT_ERROR;
293ae3
-    } else
293ae3
+    } else {
293ae3
+	state->reqid = pdu->reqid;
293ae3
         state->waiting = 1;
293ae3
+    }
293ae3
 
293ae3
     while (state->waiting) {
293ae3
         numfds = 0;
293ae3