aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/mc.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/mc.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/mc.h')
-rw-r--r--src/vlib/mc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/mc.h b/src/vlib/mc.h
index dc95b0e9074..28f94350537 100644
--- a/src/vlib/mc.h
+++ b/src/vlib/mc.h
@@ -261,6 +261,14 @@ static void __mc_serialize_msg_registration_##x (void) \
x.next_registration = vm->mc_msg_registrations; \
vm->mc_msg_registrations = &x; \
} \
+static void __mc_serialize_msg_unregistration_##x (void) \
+ __attribute__((__destructor__)) ; \
+static void __mc_serialize_msg_unregistration_##x (void) \
+{ \
+ vlib_main_t * vm = vlib_get_main(); \
+ VLIB_REMOVE_FROM_LINKED_LIST (vm->mc_msg_registrations, &x, \
+ next_registration); \
+} \
__VA_ARGS__ mc_serialize_msg_t x
typedef enum