summaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-04-05 21:32:29 +0200
committerDave Barach <openvpp@barachs.net>2018-04-09 16:06:20 +0000
commit72d2c4f3718ba5293e9e0fa8726406ee7d9f3940 (patch)
tree799a61d776b35e640bf2542148bcca946b926dca /src/vlib/buffer.h
parentf13a8787365300d757eca4624c8f8a6b7c49392b (diff)
plugins: unload plugin if early init fails
Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r--src/vlib/buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h
index 48988222de7..6d352ce580f 100644
--- a/src/vlib/buffer.h
+++ b/src/vlib/buffer.h
@@ -565,6 +565,10 @@ static void __vlib_add_buffer_callbacks_t_##x (void) \
clib_panic ("vlib buffer callbacks already registered"); \
vlib_buffer_callbacks = &__##x##_buffer_callbacks; \
} \
+static void __vlib_rm_buffer_callbacks_t_##x (void) \
+ __attribute__((__destructor__)) ; \
+static void __vlib_rm_buffer_callbacks_t_##x (void) \
+{ vlib_buffer_callbacks = 0; } \
__VA_ARGS__ vlib_buffer_callbacks_t __##x##_buffer_callbacks
/*