From: martijn Date: Sun, 29 Oct 2023 11:20:06 +0000 (+0000) Subject: When doing a get{next,bulk} below an instance we must move the OID to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f2ee28c5ef0d5b8dbc310f60e076ee33ab5ac972;p=openbsd When doing a get{next,bulk} below an instance we must move the OID to the next sibling. Not simply copying over the value of the next to use region, since that might be the parent and we would walk backwards in the tree. OK tb@ --- diff --git a/usr.sbin/snmpd/application.c b/usr.sbin/snmpd/application.c index dc60f8b0b44..c36f059345f 100644 --- a/usr.sbin/snmpd/application.c +++ b/usr.sbin/snmpd/application.c @@ -1,4 +1,4 @@ -/* $OpenBSD: application.c,v 1.26 2023/10/29 11:12:57 martijn Exp $ */ +/* $OpenBSD: application.c,v 1.27 2023/10/29 11:20:06 martijn Exp $ */ /* * Copyright (c) 2021 Martijn van Duren @@ -1368,19 +1368,17 @@ appl_varbind_backend(struct appl_varbind_internal *ivb) return -1; return 0; } - if ((region = appl_region_next(ureq->aru_ctx, - &(vb->av_oid), region)) == NULL) - goto eomv; vb->av_oid = region->ar_oid; + ober_oid_nextsibling(&(vb->av_oid)); vb->av_include = 1; + return appl_varbind_backend(ivb); } } else if (cmp == 0) { if (region->ar_instance && next && !vb->av_include) { - if ((region = appl_region_next(ureq->aru_ctx, - &(vb->av_oid), region)) == NULL) - goto eomv; vb->av_oid = region->ar_oid; + ober_oid_nextsibling(&(vb->av_oid)); vb->av_include = 1; + return appl_varbind_backend(ivb); } } ivb->avi_region = region;