clib_dlist_init (dlist_elt_t * pool, u32 index)
{
dlist_elt_t *head = pool_elt_at_index (pool, index);
- memset (head, 0xFF, sizeof (*head));
+ clib_memset (head, 0xFF, sizeof (*head));
}
static inline void
ASSERT (head->value == ~0);
- if (head->next == ~0)
+ if (head->next == ~0 || (head->next == head_index))
return ~0;
rv = head->next;