diff options
author | Stefan Zegenhagen <[email protected]> | 2012-07-31 15:10:05 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-08-02 08:48:28 +0200 |
commit | e20215f00ee5c442736269995cf147468406d796 (patch) | |
tree | 2e0c79dec023da687fbafceee4ac7f1c9ea03ef3 /lib/snmp | |
parent | 79246395195107336cd07ad123eb9ce947f3335a (diff) | |
download | otp-e20215f00ee5c442736269995cf147468406d796.tar.gz otp-e20215f00ee5c442736269995cf147468406d796.tar.bz2 otp-e20215f00ee5c442736269995cf147468406d796.zip |
[snmp/agent] Fix walk over vacmAccessTable
The get_next implementation of vacmAccessTable did not return all
available table data. Instead, it only returned the first column for
each row, and all columns for the last row available.
Fix the get_next implementation of vacmAccessTable to return all table
entries.
Diffstat (limited to 'lib/snmp')
-rw-r--r-- | lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index e7dea52857..436f15eb9c 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -774,10 +774,15 @@ do_vacmAccessTable_set(RowIndex, Cols) -> %% Cols are sorted, and all columns are > 3. +do_get_next(_RowIndex, []) -> + % Cols can be empty because we're called for each + % output of split_cols(); and one of that may well + % be empty. + []; do_get_next(RowIndex, Cols) -> case snmpa_vacm:get_next_row(RowIndex) of {NextIndex, Row} -> - F1 = fun(Col) when Col < ?vacmAccessStatus -> + F1 = fun(Col) when Col =< ?vacmAccessStatus -> {[Col | NextIndex], element(Col-3, Row)}; (_) -> endOfTable @@ -785,9 +790,9 @@ do_get_next(RowIndex, Cols) -> lists:map(F1, Cols); false -> case snmpa_vacm:get_next_row([]) of - {_NextIndex, Row} -> + {NextIndex2, Row} -> F2 = fun(Col) when Col < ?vacmAccessStatus -> - {[Col+1 | RowIndex], element(Col-2, Row)}; + {[Col+1 | NextIndex2], element(Col-2, Row)}; (_) -> endOfTable end, |