From: martijn Date: Mon, 20 Nov 2023 10:32:45 +0000 (+0000) Subject: In snmpe_writecb, don't call snmpe_prepare_read() when there's still X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bbcc24e37c28bda60e8a4e032d597b41091ce98f;p=openbsd In snmpe_writecb, don't call snmpe_prepare_read() when there's still data left inside sm_data. If there's an incomplete packet left in the buffer it will be called from snmpe_tryparse, if there's a complete packet left we can end up with new events from the tcp socket, which the tcp subsystem isn't prepared to handle. OK tb@ --- diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c index da12181df12..121692985a8 100644 --- a/usr.sbin/snmpd/snmpe.c +++ b/usr.sbin/snmpd/snmpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpe.c,v 1.91 2023/11/12 19:59:56 martijn Exp $ */ +/* $OpenBSD: snmpe.c,v 1.92 2023/11/20 10:32:45 martijn Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter @@ -648,7 +648,6 @@ snmpe_writecb(int fd, short type, void *arg) msg->sm_datalen - reqlen); nmsg->sm_datalen = msg->sm_datalen - reqlen; snmp_msgfree(msg); - snmpe_prepare_read(nmsg, fd); snmpe_tryparse(fd, nmsg); } else { snmp_msgfree(msg);