From 5f54248e1ae5f3898880e67b39a390c94d901614 Mon Sep 17 00:00:00 2001 From: Martijn van Duren Date: Thu, 16 Nov 2023 13:25:08 +0000 Subject: avi_origid must also be set when transitioning out of the APPL_VBSTATE_MUSTFILL state, else snmpd won't like use once we reach EOMV of our view of the world. OK tb@ --- usr.sbin/snmpd/application.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/snmpd/application.c b/usr.sbin/snmpd/application.c index 5e32e3b9534..7896929dd10 100644 --- a/usr.sbin/snmpd/application.c +++ b/usr.sbin/snmpd/application.c @@ -1,4 +1,4 @@ -/* $OpenBSD: application.c,v 1.38 2023/11/15 13:36:11 martijn Exp $ */ +/* $OpenBSD: application.c,v 1.39 2023/11/16 13:25:07 martijn Exp $ */ /* * Copyright (c) 2021 Martijn van Duren @@ -1368,6 +1368,8 @@ appl_response(struct appl_backend *backend, int32_t requestid, origvb->avi_state == APPL_VBSTATE_DONE) { origvb->avi_sub->avi_varbind.av_oid = origvb->avi_varbind.av_oid; + origvb->avi_sub->avi_origid = + origvb->avi_varbind.av_oid; origvb->avi_sub->avi_state = APPL_VBSTATE_NEW; } origvb = origvb->avi_next; @@ -1663,9 +1665,11 @@ appl_varbind_backend(struct appl_varbind_internal *ivb) ivb->avi_state = APPL_VBSTATE_DONE; if (ivb->avi_varbind.av_value == NULL) return -1; - if (ivb->avi_sub != NULL) + if (ivb->avi_sub != NULL) { ivb->avi_sub->avi_varbind.av_oid = ivb->avi_varbind.av_oid; + ivb->avi_sub->avi_origid = ivb->avi_origid; + } ivb = ivb->avi_sub; } while (ivb != NULL); -- cgit v1.2.3