forked from Mirror/frr
*: Cleanup keychain on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
a3dfb08662
commit
88a54b123d
|
@ -96,6 +96,8 @@ static void sigint(void)
|
||||||
zlog_notice("Terminating on signal");
|
zlog_notice("Terminating on signal");
|
||||||
eigrp_terminate();
|
eigrp_terminate();
|
||||||
|
|
||||||
|
keychain_terminate();
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1187,6 +1187,20 @@ static const struct cmd_variable_handler keychain_var_handlers[] = {
|
||||||
{.completions = NULL}
|
{.completions = NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void keychain_terminate(void)
|
||||||
|
{
|
||||||
|
struct keychain *keychain;
|
||||||
|
|
||||||
|
while (listcount(keychain_list)) {
|
||||||
|
keychain = listgetdata(listhead(keychain_list));
|
||||||
|
|
||||||
|
listnode_delete(keychain_list, keychain);
|
||||||
|
keychain_delete(keychain);
|
||||||
|
}
|
||||||
|
|
||||||
|
list_delete(&keychain_list);
|
||||||
|
}
|
||||||
|
|
||||||
void keychain_init(void)
|
void keychain_init(void)
|
||||||
{
|
{
|
||||||
keychain_list = list_new();
|
keychain_list = list_new();
|
||||||
|
|
|
@ -82,6 +82,7 @@ struct key {
|
||||||
DECLARE_QOBJ_TYPE(key);
|
DECLARE_QOBJ_TYPE(key);
|
||||||
|
|
||||||
extern void keychain_init(void);
|
extern void keychain_init(void);
|
||||||
|
extern void keychain_terminate(void);
|
||||||
extern struct keychain *keychain_lookup(const char *);
|
extern struct keychain *keychain_lookup(const char *);
|
||||||
extern struct key *key_lookup_for_accept(const struct keychain *, uint32_t);
|
extern struct key *key_lookup_for_accept(const struct keychain *, uint32_t);
|
||||||
extern struct key *key_match_for_accept(const struct keychain *, const char *);
|
extern struct key *key_match_for_accept(const struct keychain *, const char *);
|
||||||
|
|
|
@ -104,7 +104,10 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
|
||||||
}
|
}
|
||||||
|
|
||||||
ospf6_master_delete();
|
ospf6_master_delete();
|
||||||
|
|
||||||
frr_fini();
|
frr_fini();
|
||||||
|
|
||||||
|
keychain_terminate();
|
||||||
exit(status);
|
exit(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -680,6 +680,8 @@ void ospf_terminate(void)
|
||||||
ospf_vrf_terminate();
|
ospf_vrf_terminate();
|
||||||
|
|
||||||
route_map_finish();
|
route_map_finish();
|
||||||
|
|
||||||
|
keychain_terminate();
|
||||||
/* Deliberately go back up, hopefully to thread scheduler, as
|
/* Deliberately go back up, hopefully to thread scheduler, as
|
||||||
* One or more ospf_finish()'s may have deferred shutdown to a timer
|
* One or more ospf_finish()'s may have deferred shutdown to a timer
|
||||||
* thread
|
* thread
|
||||||
|
|
|
@ -85,6 +85,8 @@ static void sigint(void)
|
||||||
rip_zclient_stop();
|
rip_zclient_stop();
|
||||||
|
|
||||||
route_map_finish();
|
route_map_finish();
|
||||||
|
|
||||||
|
keychain_terminate();
|
||||||
frr_fini();
|
frr_fini();
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
Loading…
Reference in a new issue