From e20215f00ee5c442736269995cf147468406d796 Mon Sep 17 00:00:00 2001 From: Stefan Zegenhagen Date: Tue, 31 Jul 2012 15:10:05 +0200 Subject: [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. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 11 ++++++++--- 1 file 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, -- cgit v1.2.3 From feae72c93a4cdebb4287d0b52f165b638b159cb2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 2 Aug 2012 08:42:39 +0200 Subject: [snmp] Updated release notes --- lib/snmp/doc/src/notes.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index ea5648b808..80871c56fc 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -72,6 +72,17 @@ --> + +

[agent] Fix walk over vacmAccessTable. + Fix the get_next implementation of vacmAccessTable to + return all table entries.

+

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.

+

Stefan Zegenhagen

+

Own Id: OTP-10165

+
+

[manager] snmpm:log_to_io/6 -- cgit v1.2.3