summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-05 13:34:28 -0400
committerDamjan Marion <dmarion@me.com>2019-05-06 12:04:28 +0000
commit0dd9165cc7544772626d157347c2635444475052 (patch)
tree1a867a41a1a2628049ee8da9cc9f9fb8166d7f64
parent56bc738dc371f6d5384f5772087899bdac42fc17 (diff)
Add missing init fn dependency to ipsec_init
ipsec_init fails if vnet_feature_init hasn't occurred. Can happen if a particular set of plugins are loaded. Change-Id: I67b289d640c28d04e248b9a09ebcc8f205834fd2 Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/vnet/ipsec/ipsec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec.c b/src/vnet/ipsec/ipsec.c
index 3586ca2627f..4e69e734702 100644
--- a/src/vnet/ipsec/ipsec.c
+++ b/src/vnet/ipsec/ipsec.c
@@ -107,6 +107,7 @@ ipsec_add_feature (const char *arc_name,
u8 arc;
arc = vnet_get_feature_arc_index (arc_name);
+ ASSERT (arc != ~0);
*out_feature_index = vnet_get_feature_index (arc, node_name);
}
@@ -247,6 +248,10 @@ ipsec_init (vlib_main_t * vm)
ipsec_main_t *im = &ipsec_main;
ipsec_main_crypto_alg_t *a;
+ /* Backend registration requires the feature arcs to be set up */
+ if ((error = vlib_call_init_function (vm, vnet_feature_init)))
+ return (error);
+
im->vnet_main = vnet_get_main ();
im->vlib_main = vm;