summaryrefslogtreecommitdiffstats
path: root/src/vnet/feature/feature.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/vnet/feature/feature.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/vnet/feature/feature.h')
-rw-r--r--src/vnet/feature/feature.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h
index eb6c95ca2c2..70a456ee7c1 100644
--- a/src/vnet/feature/feature.h
+++ b/src/vnet/feature/feature.h
@@ -109,6 +109,14 @@ static void __vnet_add_feature_arc_registration_##x (void) \
vnet_feat_arc_##x.next = fm->next_arc; \
fm->next_arc = & vnet_feat_arc_##x; \
} \
+static void __vnet_rm_feature_arc_registration_##x (void) \
+ __attribute__((__destructor__)) ; \
+static void __vnet_rm_feature_arc_registration_##x (void) \
+{ \
+ vnet_feature_main_t * fm = &feature_main; \
+ vnet_feature_arc_registration_t *r = &vnet_feat_arc_##x; \
+ VLIB_REMOVE_FROM_LINKED_LIST (fm->next_arc, r, next); \
+} \
__VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x
#define VNET_FEATURE_INIT(x,...) \
@@ -121,6 +129,14 @@ static void __vnet_add_feature_registration_##x (void) \
vnet_feat_##x.next = fm->next_feature; \
fm->next_feature = & vnet_feat_##x; \
} \
+static void __vnet_rm_feature_registration_##x (void) \
+ __attribute__((__destructor__)) ; \
+static void __vnet_rm_feature_registration_##x (void) \
+{ \
+ vnet_feature_main_t * fm = &feature_main; \
+ vnet_feature_registration_t *r = &vnet_feat_##x; \
+ VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \
+} \
__VA_ARGS__ vnet_feature_registration_t vnet_feat_##x
void