Skip to content

Commit

Permalink
isisd, lib: Cleanup linked list associated with snmp
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Aug 8, 2024
1 parent db986ad commit 208c53c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions isisd/isis_snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2826,6 +2826,13 @@ static int isis_snmp_init(struct event_loop *tm)
return 0;
}

static int isis_snmp_terminate(void)
{
smux_terminate();

return 0;
}

/*
* ISIS notification functions: we have one function per notification
*/
Expand Down Expand Up @@ -3448,6 +3455,7 @@ static int isis_snmp_module_init(void)
hook_register(isis_circuit_del_hook, isis_circuit_snmp_id_free);

hook_register(frr_late_init, isis_snmp_init);
hook_register(frr_fini, isis_snmp_terminate);
return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions lib/agentx.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,9 @@ void smux_events_update(void)
agentx_events_update();
}

void smux_terminate(void)
{
if (events)
list_delete(&events);
}
#endif /* SNMP_AGENTX */
1 change: 1 addition & 0 deletions lib/smux.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ extern bool smux_enabled(void);

extern void libagentx_init(void);
extern void smux_init(struct event_loop *tm);
extern void smux_terminate(void);
extern void smux_agentx_enable(void);
extern void smux_register_mib(const char *, struct variable *, size_t, int,
oid[], size_t);
Expand Down

0 comments on commit 208c53c

Please sign in to comment.