summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-04-09 20:59:53 +0200
committerDamjan Marion <damarion@cisco.com>2018-04-09 21:09:21 +0200
commit13adc3d48d562b13422259d8c7ac411fb43c7e8b (patch)
tree2b2e379fbd0c964a0773a3aa42ad6ee9b0cbf368 /src/vlib
parent87dad11c8717735479e57cf6c065c7a7963c3aa3 (diff)
features: don't break linked list, create separate one for arc
We need to keep original linked list so destructire can remove entries. Change-Id: I5ff5ca0e1a417d88707255207725bba46433c943 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/init.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/vlib/init.h b/src/vlib/init.h
index 1eddbb13d5a..f163ee2fb7a 100644
--- a/src/vlib/init.h
+++ b/src/vlib/init.h
@@ -81,20 +81,22 @@ typedef struct vlib_config_function_runtime_t
#define VLIB_REMOVE_FROM_LINKED_LIST(first,p,next) \
{ \
+ ASSERT (first); \
if (first == p) \
first = (p)->next; \
else \
{ \
__typeof__ (p) current = first; \
- while (current->next) \
- { \
- if (current->next == p) \
- { \
- current->next = current->next->next; \
- break; \
- } \
- current = current->next; \
- } \
+ while (current->next) \
+ { \
+ if (current->next == p) \
+ { \
+ current->next = current->next->next; \
+ break; \
+ } \
+ current = current->next; \
+ } \
+ ASSERT (current); \
} \
}