scotty-1.2.5 snmp walk bug

Icarus Sparry (ccsis@bath.ac.uk)
Fri, 26 May 1995 09:53:34 +0100

A SNMPv1 session generates incorrect SNMP packets for a walk. In
particular the error_index is not set to 0, which is required for
SNMPv1. The following patch will fix it. Icarus

*** snmp/tcl.c.orig Wed Apr 26 12:00:20 1995
--- snmp/tcl.c Thu May 25 18:15:31 1995
***************
*** 1156,1163 ****

while (1) {

! pdu->error_status = 0; /* non-repeaters */
! pdu->error_index = 16 / oidc; /* man-repetitions -- why this ?? */
pdu->request_id = ++sess->reqid;

result = SNMP_Encode (interp, sess, pdu, NULL, NULL);
--- 1156,1168 ----

while (1) {

! if (sess->version == SNMPv1) {
! pdu->error_status = 0;
! pdu->error_index = 0;
! } else {
! pdu->error_status = 0; /* non-repeaters */
! pdu->error_index = 16 / oidc; /* max-repetitions */
! }
pdu->request_id = ++sess->reqid;

result = SNMP_Encode (interp, sess, pdu, NULL, NULL);