summaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/init.h8
-rw-r--r--vlib/vlib/unix/main.c3
2 files changed, 10 insertions, 1 deletions
diff --git a/vlib/vlib/init.h b/vlib/vlib/init.h
index 9d940d0745f..c2a4014fd5b 100644
--- a/vlib/vlib/init.h
+++ b/vlib/vlib/init.h
@@ -169,6 +169,14 @@ static void __vlib_add_config_function_##x (void) \
_error; \
})
+/* Don't call given init function: used to suppress parts of the netstack */
+#define vlib_mark_init_function_complete(vm, x) \
+ ({ \
+ extern vlib_init_function_t * VLIB_INIT_FUNCTION_SYMBOL (x); \
+ vlib_init_function_t * _f = VLIB_INIT_FUNCTION_SYMBOL (x); \
+ hash_set1 (vm->init_functions_called, _f); \
+ })
+
#define vlib_call_post_graph_init_function(vm, x) \
({ \
extern vlib_init_function_t * VLIB_POST_GRAPH_INIT_FUNCTION_SYMBOL (x); \
diff --git a/vlib/vlib/unix/main.c b/vlib/vlib/unix/main.c
index 6ff63f84733..d6976b10751 100644
--- a/vlib/vlib/unix/main.c
+++ b/vlib/vlib/unix/main.c
@@ -431,7 +431,8 @@ int vlib_unix_main (int argc, char * argv[])
return i;
unformat_init_command_line (&input, (char **)vm->argv);
- vm->init_functions_called = hash_create (0, /* value bytes */ 0);
+ if (vm->init_functions_called == 0)
+ vm->init_functions_called = hash_create (0, /* value bytes */ 0);
e = vlib_call_all_config_functions (vm, &input, 1 /* early */);
if (e != 0)
{