From bbcc24e37c28bda60e8a4e032d597b41091ce98f Mon Sep 17 00:00:00 2001 From: martijn Date: Mon, 20 Nov 2023 10:32:45 +0000 Subject: [PATCH] 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@ --- usr.sbin/snmpd/snmpe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); -- 2.20.1