diff options
author | Gerhard Roth <gerhard@cvs.openbsd.org> | 2017-07-27 14:04:17 +0000 |
---|---|---|
committer | Gerhard Roth <gerhard@cvs.openbsd.org> | 2017-07-27 14:04:17 +0000 |
commit | d3c9e5d100082faa2283b2f8e8d347d38f6463b4 (patch) | |
tree | 21285dab689742d8412a369570638ab894176857 /usr.sbin/snmpd/snmpe.c | |
parent | af08e4239d25c6700d16463c12cb93fb2be43b30 (diff) |
Heed the non-repeaters of GetBulkRequests and make sure to set
error-status and error-index to zero in the response PDU.
ok sthen@
Diffstat (limited to 'usr.sbin/snmpd/snmpe.c')
-rw-r--r-- | usr.sbin/snmpd/snmpe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c index ec50621a6eb..34fe283baa5 100644 --- a/usr.sbin/snmpd/snmpe.c +++ b/usr.sbin/snmpd/snmpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpe.c,v 1.47 2017/04/21 13:50:23 jca Exp $ */ +/* $OpenBSD: snmpe.c,v 1.48 2017/07/27 14:04:16 gerhard Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -439,7 +439,8 @@ snmpe_parsevarbinds(struct snmp_message *msg) case SNMP_C_GETBULKREQ: ret = mps_getbulkreq(msg, &msg->sm_c, &msg->sm_end, &o, - msg->sm_maxrepetitions); + (msg->sm_i <= msg->sm_nonrepeaters) + ? 1 : msg->sm_maxrepetitions); if (ret == 0 || ret == 1) break; msg->sm_error = SNMP_ERROR_NOSUCHNAME; @@ -467,6 +468,8 @@ snmpe_parsevarbinds(struct snmp_message *msg) } msg->sm_errstr = "none"; + msg->sm_error = 0; + msg->sm_errorindex = 0; return (ret); varfail: |