We need to keep original linked list so destructire can remove entries.
Change-Id: I5ff5ca0e1a417d88707255207725bba46433c943
Signed-off-by: Damjan Marion <damarion@cisco.com>
#define VLIB_REMOVE_FROM_LINKED_LIST(first,p,next) \
{ \
#define VLIB_REMOVE_FROM_LINKED_LIST(first,p,next) \
{ \
if (first == p) \
first = (p)->next; \
else \
{ \
__typeof__ (p) current = 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); \
arc_index = areg->feature_arc_index;
next = freg->next;
arc_index = areg->feature_arc_index;
next = freg->next;
- freg->next = fm->next_feature_by_arc[arc_index];
+ freg->next_in_arc = fm->next_feature_by_arc[arc_index];
fm->next_feature_by_arc[arc_index] = freg;
/* next */
fm->next_feature_by_arc[arc_index] = freg;
/* next */
{
hash_set_mem (fm->next_feature_by_name[arc_index],
freg->node_name, pointer_to_uword (freg));
{
hash_set_mem (fm->next_feature_by_name[arc_index],
freg->node_name, pointer_to_uword (freg));
+ freg = freg->next_in_arc;
while (freg)
{
vlib_cli_output (vm, " %s\n", freg->node_name);
while (freg)
{
vlib_cli_output (vm, " %s\n", freg->node_name);
+ freg = freg->next_in_arc;
typedef struct _vnet_feature_registration
{
/** next registration in list of all registrations*/
typedef struct _vnet_feature_registration
{
/** next registration in list of all registrations*/
- struct _vnet_feature_registration *next;
+ struct _vnet_feature_registration *next, *next_in_arc;
/** Feature arc name */
char *arc_name;
/** Graph node name */
/** Feature arc name */
char *arc_name;
/** Graph node name */
- this_reg = this_reg->next;
+ this_reg = this_reg->next_in_arc;
}
n_features = vec_len (node_names);
}
n_features = vec_len (node_names);