aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-08-02 08:50:18 +0200
committerMicael Karlberg <[email protected]>2012-08-02 08:50:18 +0200
commit3cec104dae525879756d19629404eddfb9910d75 (patch)
tree0c400c2ba4ec0021b90dd33b0fdfb2725b76419d
parent79246395195107336cd07ad123eb9ce947f3335a (diff)
parentfeae72c93a4cdebb4287d0b52f165b638b159cb2 (diff)
downloadotp-3cec104dae525879756d19629404eddfb9910d75.tar.gz
otp-3cec104dae525879756d19629404eddfb9910d75.tar.bz2
otp-3cec104dae525879756d19629404eddfb9910d75.zip
Merge branch 'bmk/snmp/agent/walk_over_vacmAccessTable/OTP-10165' into bmk/snmp/snmp4221_integration
-rw-r--r--lib/snmp/doc/src/notes.xml11
-rw-r--r--lib/snmp/src/agent/snmp_view_based_acm_mib.erl11
2 files changed, 19 insertions, 3 deletions
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
@@ -73,6 +73,17 @@
<list type="bulleted">
<item>
+ <p>[agent] Fix walk over vacmAccessTable.
+ Fix the get_next implementation of vacmAccessTable to
+ return all table entries. </p>
+ <p>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. </p>
+ <p>Stefan Zegenhagen</p>
+ <p>Own Id: OTP-10165</p>
+ </item>
+
+ <item>
<p>[manager]
<seealso marker="snmpm#log_to_io">snmpm:log_to_io/6</seealso>
did not use the LogName argument. </p>
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,