From: martijn Date: Thu, 16 Nov 2023 14:35:25 +0000 (+0000) Subject: In appl_processpdu() no need to set avi_next, and only set av_next up X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=80990c3a670d56505b23376f9793c486ca290616;p=openbsd In appl_processpdu() no need to set avi_next, and only set av_next up to varbindlen, since its only use is to print the varbindlist via appl_pdu_log() and both are further properly initialized in appl_request_upstream_resolve(). This fixes a cosmetic off by one for getbulk requests. OK tb@ --- diff --git a/usr.sbin/snmpd/application.c b/usr.sbin/snmpd/application.c index 7896929dd10..7941f5c1a7b 100644 --- a/usr.sbin/snmpd/application.c +++ b/usr.sbin/snmpd/application.c @@ -1,4 +1,4 @@ -/* $OpenBSD: application.c,v 1.39 2023/11/16 13:25:07 martijn Exp $ */ +/* $OpenBSD: application.c,v 1.40 2023/11/16 14:35:25 martijn Exp $ */ /* * Copyright (c) 2021 Martijn van Duren @@ -919,15 +919,11 @@ appl_processpdu(struct snmp_message *statereference, const char *ctxname, &(ureq->aru_vblist[i].avi_varbind.av_oid)); ureq->aru_vblist[i].avi_origid = ureq->aru_vblist[i].avi_varbind.av_oid; - if (i + 1 < ureq->aru_varbindlen) { - ureq->aru_vblist[i].avi_next = - &(ureq->aru_vblist[i + 1]); + if (i + 1 < varbindlen) ureq->aru_vblist[i].avi_varbind.av_next = &(ureq->aru_vblist[i + 1].avi_varbind); - } else { - ureq->aru_vblist[i].avi_next = NULL; + else ureq->aru_vblist[i].avi_varbind.av_next = NULL; - } varbind = varbind->be_next; }