Skip to content

Commit bb51d0e

Browse files
author
Boris Lytochkin
committed
Fixed SNMP_ERR_TOOBIG handling for bulk walk operations
1 parent 20eb8e4 commit bb51d0e

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
@@ -34,6 +34,9 @@ PHP NEWS
3434
- ZIP:
3535
. Fixed Bug #66321 (ZipArchive::open() ze_obj->filename_len not real). (Remi)
3636

37+
- SNMP:
38+
. Fixed SNMP_ERR_TOOBIG handling for bulk walk operations (Boris Lytochkin)
39+
3740
12 Dec 2013, PHP 5.4.23
3841

3942
- Core:

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)