Skip to content

Commit a6fa520

Browse files
author
Boris Lytochkin
committed
Merge branch '5.4' into PHP-5.4
* 5.4: keep 'em sorted Fixed SNMP_ERR_TOOBIG handling for bulk walk operations
2 parents 20eb8e4 + a7c50cc commit a6fa520

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ PHP NEWS
2727
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
2828
(Adam)
2929

30+
- SNMP:
31+
. Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
32+
3033
- XSL
3134
. Fixed bug #49634 (Segfault throwing an exception in a XSL registered
3235
function). (Mike)

ext/snmp/snmp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,12 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
896896
keepwalking = 1;
897897
}
898898
} else {
899+
if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1) { /* Answer will not fit into single packet */
900+
objid_query->max_repetitions /= 2;
901+
snmp_free_pdu(response);
902+
keepwalking = 1;
903+
continue;
904+
}
899905
if (!(st & SNMP_CMD_WALK) || response->errstat != SNMP_ERR_NOSUCHNAME || Z_TYPE_P(return_value) == IS_BOOL) {
900906
for ( count=1, vars = response->variables;
901907
vars && count != response->errindex;

0 commit comments

Comments
 (0)