aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-06-15 14:29:08 +0200
committerOle Troan <ot@cisco.com>2016-06-15 16:10:08 +0200
commit3b3688f9d3a640a169e9c7fc858d36ab3aeb147e (patch)
tree5fc72f464da8410e9a838aef62c1bc5a8886a181 /vlib
parentf0f852251c885fc5f73125a4365cf356feeb0cdd (diff)
6rd: Move to plugin
- Change toplevel plugins make target. Now builds all plugins under plugins/. (Apart from sample-plugin). - Move sixrd code to plugins directory and make necessary changes to make it a plugin - Remove 6rd hooks from IP lookup code Change-Id: I447e92e3bee240cd8de01d0abac2e1708e8c27d1 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/unix/plugin.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/vlib/vlib/unix/plugin.c b/vlib/vlib/unix/plugin.c
index 3411ef340af..93bfbb71b7c 100644
--- a/vlib/vlib/unix/plugin.c
+++ b/vlib/vlib/unix/plugin.c
@@ -61,11 +61,13 @@ load_one_plugin (plugin_main_t *pm, plugin_info_t *pi, int from_early_init)
pi->handle = handle;
+
register_handle = dlsym (pi->handle, "vlib_plugin_register");
if (register_handle == 0)
{
dlclose (handle);
- return 0;
+ clib_warning("Plugin missing vlib_plugin_register: %s\n", (char *)pi->name);
+ return 1;
}
fp = register_handle;
@@ -148,9 +150,12 @@ int vlib_load_new_plugins (plugin_main_t *pm, int from_early_init)
plugin_name = format (0, "%s/%s%c", plugin_path[i],
entry->d_name, 0);
-
+
+ /* Only accept .so */
+ char * ext = strrchr((const char *)plugin_name, '.');
/* unreadable */
- if (stat ((char *)plugin_name, &statb) < 0)
+ if(!ext || (strcmp(ext, ".so") != 0) ||
+ stat ((char *)plugin_name, &statb) < 0)
{
ignore:
vec_free (plugin_name);