aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/manager/snmpm_net_if.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2010-03-03 12:00:00 +0100
committerBjörn Gustavsson <[email protected]>2010-08-20 08:43:26 +0200
commit2fe5bce0ff7998ed4dcc833a4ae9b4b5feb450e2 (patch)
tree123c04445d7b1ad6f8250dd9bb09d471cdf6de1a /lib/snmp/src/manager/snmpm_net_if.erl
parentdfd80f7cea795bfb3a35eaea2c0bc98960002aa2 (diff)
downloadotp-2fe5bce0ff7998ed4dcc833a4ae9b4b5feb450e2.tar.gz
otp-2fe5bce0ff7998ed4dcc833a4ae9b4b5feb450e2.tar.bz2
otp-2fe5bce0ff7998ed4dcc833a4ae9b4b5feb450e2.zip
snmp: Patch erl_1108
OTP-8480 [agent] A minor mnesia related performance improvement. OTP-8481 [manager] Fixed an upgrade/downgrade problem. Upgrade/downgrade from/to 4.13.5 did not work for the net-if process. This has now been fixed
Diffstat (limited to 'lib/snmp/src/manager/snmpm_net_if.erl')
-rw-r--r--lib/snmp/src/manager/snmpm_net_if.erl43
1 files changed, 40 insertions, 3 deletions
diff --git a/lib/snmp/src/manager/snmpm_net_if.erl b/lib/snmp/src/manager/snmpm_net_if.erl
index ad39157721..07156dacd9 100644
--- a/lib/snmp/src/manager/snmpm_net_if.erl
+++ b/lib/snmp/src/manager/snmpm_net_if.erl
@@ -441,7 +441,7 @@ handle_info(Info, State) ->
%% Returns: any (ignored by gen_server)
%%--------------------------------------------------------------------
terminate(Reason, #state{log = Log, irgc = IrGcRef}) ->
- ?vdebug("terminate: ~p",[Reason]),
+ ?vdebug("terminate: ~p", [Reason]),
irgc_stop(IrGcRef),
%% Close logs
do_close_log(Log),
@@ -462,22 +462,59 @@ do_close_log(_) ->
%% Returns: {ok, NewState}
%%----------------------------------------------------------------------
+code_change({down, _Vsn}, OldState, downgrade_to_pre_4_14) ->
+ ?d("code_change(down, downgrade_to_pre_4_14) -> entry with"
+ "~n OldState: ~p", [OldState]),
+ #state{server = Server,
+ note_store = NoteStore,
+ sock = Sock,
+ mpd_state = MpdState,
+ log = {OldLog, Type},
+ irb = IRB,
+ irgc = IRGC} = OldState,
+ NewLog = snmp_log:downgrade(OldLog),
+ State =
+ {state, Server, NoteStore, Sock, MpdState, {NewLog, Type}, IRB, IRGC},
+ {ok, State};
+
code_change({down, _Vsn}, OldState, downgrade_to_pre_4_16) ->
- ?d("code_change(down) -> entry", []),
+ ?d("code_change(down, downgrade_to_pre_4_16) -> entry with"
+ "~n OldState: ~p", [OldState]),
{OldLog, Type} = OldState#state.log,
NewLog = snmp_log:downgrade(OldLog),
State = OldState#state{log = {NewLog, Type}},
{ok, State};
% upgrade
+code_change(_Vsn, OldState, upgrade_from_pre_4_14) ->
+ ?d("code_change(up, upgrade_from_pre_4_14) -> entry with"
+ "~n OldState: ~p", [OldState]),
+ {state, Server, NoteStore, Sock, MpdState, {OldLog, Type}, IRB, IRGC} =
+ OldState,
+ NewLog = snmp_log:upgrade(OldLog),
+ State = #state{server = Server,
+ note_store = NoteStore,
+ sock = Sock,
+ mpd_state = MpdState,
+ log = {NewLog, Type},
+ irb = IRB,
+ irgc = IRGC,
+ filter = ?DEFAULT_FILTER_MODULE},
+ {ok, State};
+
code_change(_Vsn, OldState, upgrade_from_pre_4_16) ->
- ?d("code_change(up) -> entry", []),
+ ?d("code_change(up, upgrade_from_pre_4_16) -> entry with"
+ "~n OldState: ~p", [OldState]),
{OldLog, Type} = OldState#state.log,
NewLog = snmp_log:upgrade(OldLog),
State = OldState#state{log = {NewLog, Type}},
{ok, State};
code_change(_Vsn, State, _Extra) ->
+ ?d("code_change -> entry with"
+ "~n Vsn: ~p"
+ "~n State: ~p"
+ "~n Extra: ~p", [_Vsn, State, _Extra]),
{ok, State}.