summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/linklist.c7
-rw-r--r--lib/linklist.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/linklist.c b/lib/linklist.c
index 370b2fa615..4b16f07dd1 100644
--- a/lib/linklist.c
+++ b/lib/linklist.c
@@ -159,6 +159,13 @@ listnode_add_after (struct list *list, struct listnode *pp, void *val)
list->count++;
}
+/* Move given listnode to tail of the list */
+void
+listnode_move_to_tail (struct list *l, struct listnode *n)
+{
+ LISTNODE_DETACH(l,n);
+ LISTNODE_ATTACH(l,n);
+}
/* Delete specific date pointer from the list. */
void
diff --git a/lib/linklist.h b/lib/linklist.h
index 88f4a03912..6209c8b9d6 100644
--- a/lib/linklist.h
+++ b/lib/linklist.h
@@ -68,6 +68,7 @@ extern void list_free (struct list *);
extern void listnode_add (struct list *, void *);
extern void listnode_add_sort (struct list *, void *);
extern void listnode_add_after (struct list *, struct listnode *, void *);
+extern void listnode_move_to_tail (struct list *, struct listnode *);
extern void listnode_delete (struct list *, void *);
extern struct listnode *listnode_lookup (struct list *, void *);
extern void *listnode_head (struct list *);