diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-22 18:00:10 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-23 09:04:33 +0100 |
commit | 5e280e568809c18589cc58d785c7f49e0bab3945 (patch) | |
tree | 6b20ae450c1c521ca16e427f61e88d940f939edc /zebra/zebra_ns.c | |
parent | zebra: fix misc changes related to link updates with correct zns (diff) | |
download | frr-5e280e568809c18589cc58d785c7f49e0bab3945.tar.xz frr-5e280e568809c18589cc58d785c7f49e0bab3945.zip |
zebra: move hash rules creation to the vrf_enable place
The vrf netns usage makes a crash, when deleting vrf, due to the hash
list of rules not initialised for non default VRF.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_ns.c')
-rw-r--r-- | zebra/zebra_ns.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c index 29c179245..d841bdeec 100644 --- a/zebra/zebra_ns.c +++ b/zebra/zebra_ns.c @@ -135,6 +135,10 @@ int zebra_ns_enable(ns_id_t ns_id, void **info) zns->ns_id = ns_id; + zns->rules_hash = + hash_create_size(8, zebra_pbr_rules_hash_key, + zebra_pbr_rules_hash_equal, "Rules Hash"); + #if defined(HAVE_RTADV) rtadv_init(zns); #endif @@ -287,9 +291,6 @@ int zebra_ns_init(void) /* Default NS is activated */ zebra_ns_enable(ns_id, (void **)&dzns); - dzns->rules_hash = - hash_create_size(8, zebra_pbr_rules_hash_key, - zebra_pbr_rules_hash_equal, "Rules Hash"); if (vrf_is_backend_netns()) { ns_add_hook(NS_NEW_HOOK, zebra_ns_new); ns_add_hook(NS_ENABLE_HOOK, zebra_ns_enabled); |