summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Lytochkin <lytboris@php.net>2013-12-20 01:00:46 +0400
committerBoris Lytochkin <lytboris@php.net>2013-12-20 01:00:46 +0400
commita6fa52028f6391da6876d4c7eec20be8fb5a0bc0 (patch)
tree5c0cb2326382ea26e5d4723674cbe903c1ce35c7
parent20eb8e4d11d46c399f2920af0a552007d8d5d608 (diff)
parenta7c50ccc67912c65fe1b56e64d60a5521657e66f (diff)
downloadphp-git-a6fa52028f6391da6876d4c7eec20be8fb5a0bc0.tar.gz
Merge branch '5.4' into PHP-5.4
* 5.4: keep 'em sorted Fixed SNMP_ERR_TOOBIG handling for bulk walk operations
-rw-r--r--NEWS3
-rw-r--r--ext/snmp/snmp.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 6dea019bc3..75c39ee980 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,9 @@ PHP NEWS
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
(Adam)
+- SNMP:
+ . Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
+
- XSL
. Fixed bug #49634 (Segfault throwing an exception in a XSL registered
function). (Mike)
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 1bf0b3a4da..6a4eca5f03 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -896,6 +896,12 @@ retry:
keepwalking = 1;
}
} else {
+ if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1) { /* Answer will not fit into single packet */
+ objid_query->max_repetitions /= 2;
+ snmp_free_pdu(response);
+ keepwalking = 1;
+ continue;
+ }
if (!(st & SNMP_CMD_WALK) || response->errstat != SNMP_ERR_NOSUCHNAME || Z_TYPE_P(return_value) == IS_BOOL) {
for ( count=1, vars = response->variables;
vars && count != response->errindex;