mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 20:55:25 +00:00
zebra: start the netns notification mechanism after ns initialisation
when zebra is run, by using vrf netns backend mode, then the parser detector of netns is run before forcing the default vrf to a possible value. In that case, there is a possibility that the forced '-o' option will create a second vrf with same name, whereas this option should be there to uniquely have a default vrf with a value. To make things consistent, the forced value will be priorised. Then, the notifier will attempt to create vrf contexts. The expectation is that the creation will fail, due to an already present vrf with same name. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
17c7cb4acd
commit
edbc33221c
@ -407,10 +407,7 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Initialize NS( and implicitly the VRF module), and make kernel
|
||||
* routing socket. */
|
||||
zebra_ns_init();
|
||||
if (vrf_default_name_configured)
|
||||
vrf_set_default_name(vrf_default_name_configured,
|
||||
true);
|
||||
zebra_ns_init((const char *)vrf_default_name_configured);
|
||||
zebra_vty_init();
|
||||
access_list_init();
|
||||
prefix_list_init();
|
||||
|
@ -183,7 +183,7 @@ int zebra_ns_final_shutdown(struct ns *ns)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int zebra_ns_init(void)
|
||||
int zebra_ns_init(const char *optional_default_name)
|
||||
{
|
||||
ns_id_t ns_id;
|
||||
ns_id_t ns_id_external;
|
||||
@ -207,6 +207,10 @@ int zebra_ns_init(void)
|
||||
/* Default NS is activated */
|
||||
zebra_ns_enable(ns_id_external, (void **)&dzns);
|
||||
|
||||
if (optional_default_name)
|
||||
vrf_set_default_name(optional_default_name,
|
||||
true);
|
||||
|
||||
if (vrf_is_backend_netns()) {
|
||||
ns_add_hook(NS_NEW_HOOK, zebra_ns_new);
|
||||
ns_add_hook(NS_ENABLE_HOOK, zebra_ns_enabled);
|
||||
|
@ -60,7 +60,7 @@ struct zebra_ns {
|
||||
|
||||
struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id);
|
||||
|
||||
int zebra_ns_init(void);
|
||||
int zebra_ns_init(const char *optional_default_name);
|
||||
int zebra_ns_enable(ns_id_t ns_id, void **info);
|
||||
int zebra_ns_disabled(struct ns *ns);
|
||||
int zebra_ns_early_shutdown(struct ns *ns);
|
||||
|
Loading…
Reference in New Issue
Block a user