Hi,

snmpd uses the same storage for sm_error and sm_nonrepeaters. Same applies
to sm_errorindex and sm_maxrepetitions. If we produce a response PDU to
a getbulk request, sm_error will carry the number of non-repeaters from
the request and sm_errorindex the max. number of repetitions. This is
wrong. We should clears those fields in case of success.

Gerhard


Index: usr.sbin/snmpd/snmpe.c
===================================================================
RCS file: /cvs/src/usr.sbin/snmpd/snmpe.c,v
retrieving revision 1.47
diff -u -p -u -p -r1.47 snmpe.c
--- usr.sbin/snmpd/snmpe.c      21 Apr 2017 13:50:23 -0000      1.47
+++ usr.sbin/snmpd/snmpe.c      27 Jul 2017 08:49:31 -0000
@@ -467,6 +467,8 @@ snmpe_parsevarbinds(struct snmp_message 
        }
 
        msg->sm_errstr = "none";
+       msg->sm_error = 0;
+       msg->sm_errorindex = 0;
 
        return (ret);
  varfail:

Reply via email to