Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 179891 Details for
Bug 256531
net-analyzer/net-snmp-5.4.1 (and 5.4.2.1): Infinite retry loop when agent replies with invalid error-index on non-set request
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch for the problem
net-snmp-5.4.2.1.infinite-fix-loop.patch (text/plain), 1.89 KB, created by
Doug
on 2009-01-27 17:03:37 UTC
(
hide
)
Description:
The patch for the problem
Filename:
MIME Type:
Creator:
Doug
Created:
2009-01-27 17:03:37 UTC
Size:
1.89 KB
patch
obsolete
>--- snmplib/snmp_client.c.original 2009-01-26 12:53:28.000000000 -0500 >+++ snmplib/snmp_client.c 2009-01-26 12:51:18.000000000 -0500 >@@ -580,8 +580,9 @@ > * The command is set to the input command and the reqid, errstat, and > * errindex are set to default values. > * If the error status didn't indicate an error, the error index didn't >- * indicate a variable, the pdu wasn't a get response message, or there >- * would be no remaining variables, this function will return 0. >+ * indicate a variable, the pdu wasn't a get response message, there >+ * would be no remaining variables, or the marked variable was not >+ * present in the initial request, this function will return 0. > * If everything was successful, a pointer to the fixed cloned pdu will > * be returned. > */ >@@ -590,10 +591,24 @@ > { > netsnmp_pdu *newpdu; > >- if ((pdu->command != SNMP_MSG_RESPONSE) >+ if ( >+ // We're only going to fix a PDU if it was a *response* to us. >+ (pdu->command != SNMP_MSG_RESPONSE) >+ // We're only going to fix a PDU that had an error. > || (pdu->errstat == SNMP_ERR_NOERROR) >+ // We're only going to fix a PDU that has varbinds. > || (0 == pdu->variables) >- || (pdu->errindex <= 0)) { >+ // We're only going to fix a PDU with a positive error-index. >+ || (pdu->errindex <= 0) >+ // We're only going to fix a PDU if we can actually remove >+ // the varbind that was listed as being "bad". If the number >+ // of varbinds is *less* than the error-index value, then >+ // we can't really do anything except simply resend the PDU >+ // and hope for a better response, and that's not a good >+ // thing to do; previously, this had led to infinite loops >+ // of send, receive, and resend. >+ || (pdu->errindex > snmp_varbind_len(pdu)) >+ ) { > return 0; /* pre-condition tests fail */ > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 256531
: 179891