Permalink
Browse files

Merge branch 'sze/snmp-fix-invalid-return-snmpTargetAddrEx' into pu

  • Loading branch information...
2 parents a7bca55 + 9e8e572 commit 63a95eabfd4b139e6e5a00e41430a44b9ccaa5d8 @proxyles proxyles committed Oct 11, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/snmp/src/agent/snmp_community_mib.erl
@@ -509,17 +509,17 @@ snmpTargetAddrExtTable(set, RowIndex, Cols0) ->
case (catch verify_snmpTargetAddrExtTable_cols(Cols0, [])) of
{ok, Cols} ->
NCols = conv3(Cols),
- snmp_generic:table_func(set, RowIndex, NCols,
- db(snmpTargetAddrExtTable));
+ conv4(snmp_generic:table_func(set, RowIndex, NCols,
+ db(snmpTargetAddrExtTable)));
Error ->
Error
end;
snmpTargetAddrExtTable(is_set_ok, RowIndex, Cols0) ->
case (catch verify_snmpTargetAddrExtTable_cols(Cols0, [])) of
{ok, Cols} ->
NCols = conv3(Cols),
- snmp_generic:table_func(is_set_ok, RowIndex, NCols,
- db(snmpTargetAddrExtTable));
+ conv4(snmp_generic:table_func(is_set_ok, RowIndex, NCols,
+ db(snmpTargetAddrExtTable)));
Error ->
Error
end.
@@ -583,6 +583,10 @@ conv3([{Idx, Val}|T]) -> [{Idx+10, Val} | conv3(T)];
conv3([]) -> [].
+conv4({ErrAtom, ErrIdx}) -> {ErrAtom, ErrIdx - 10};
+conv4(X) -> X.
+
+
get(Name, RowIndex, Cols) ->
snmp_generic:handle_table_get(db(Name), RowIndex, Cols, foi(Name)).

0 comments on commit 63a95ea

Please sign in to comment.