This is a call for votes on delaying the current pending releases until a
protocol bug can be fixed. I don't have a patch, but I think a protocol bug
should be a show stopper.
It seems that when a message response exceeds session->sndMsgMaxSize or
transport->msgMaxSize, it is simply dropped. Section 4.2. (PDU Processing) of
RFC 3416 clearly states that a tooBig error should be returned.
I have a simple test that works for v1/v2c requests, but it causes a segfault
for v3 requests.
The test case (reported in the IRC channel) is to create several extend
entries that cat a large text file. Say 7 extends that cat a 10k file. A
snmpget for all 7 will exceed the 64k max size and should return tooBig.
NOTE: I'm not calling for a vote on this particular patch, but on whether or
not the releases should be delayed until a proper fix can be found.
diff --git a/net-snmp/agent/snmp_agent.c b/net-snmp/agent/snmp_agent.c
index db06714..b24dc26 100644
--- a/net-snmp/agent/snmp_agent.c
+++ b/net-snmp/agent/snmp_agent.c
@@ -1584,6 +1584,7 @@ netsnmp_wrap_up_request(netsnmp_agent_session *asp, int
status)
netsnmp_processing_set = NULL;
}
+ retry:
if (asp->pdu) {
/*
* If we've got an error status, then this needs to be
@@ -1733,6 +1734,14 @@ netsnmp_wrap_up_request(netsnmp_agent_session *asp, int
status)
if (!snmp_send(asp->session, asp->pdu)) {
netsnmp_variable_list *var_ptr;
snmp_perror("send response");
+
+ if (SNMPERR_TOO_LONG == asp->session->s_snmp_errno) {
+ status = SNMP_ERR_TOOBIG;
+ goto retry;
+ }
+
+
+
for (var_ptr = asp->pdu->variables; var_ptr != NULL;
var_ptr = var_ptr->next_variable) {
size_t c_oidlen = 256, c_outlen = 0;
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders