Skip to content

Commit 5ce843a

Browse files
author
Boris Lytochkin
committed
Merge branch '5.6' into PHP-5.6
* 5.6: Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
2 parents d4f4b66 + 285c0bc commit 5ce843a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)