On Mon, 9 Jan 2006 13:35:41 -0500 Robert wrote:
RS> If you are using a 5.2 version, try the attached patch and see if it helps.
Forgot to attach... here it is...
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
Index: snmplib/snmp_api.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/snmp_api.c,v
retrieving revision 5.68.2.15
retrieving revision 5.95
diff -u -p -r5.68.2.15 -r5.95
--- snmplib/snmp_api.c 10 Oct 2005 12:01:27 -0000 5.68.2.15
+++ snmplib/snmp_api.c 5 Dec 2005 15:55:31 -0000 5.95
@@ -5562,12 +5628,18 @@ _sess_read(void *sessp, fd_set * fdset)
if (pdulen > isp->packet_len || pdulen == 0) {
/*
- * We don't have a complete packet yet. Return, and wait for
- * more data to arrive.
+ * We don't have a complete packet yet. If we've already
+ * processed a packet, break out so we'll shift this packet
+ * to the start of the buffer. If we're already at the
+ * start, simply return and wait for more data to arrive.
*/
DEBUGMSGTL(("sess_read",
"pkt not complete (need %d got %d so far)\n",
pdulen, isp->packet_len));
+
+ if (pptr != isp->packet)
+ break; /* opaque freed for us outside of loop. */
+
if (opaque != NULL) {
SNMP_FREE(opaque);
}