]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Tweak previous iface RR write patch to avoid free/malloc & redundant log
authorPaul Jakma <paul@opensourcerouting.org>
Thu, 9 Oct 2014 15:05:15 +0000 (16:05 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 May 2016 00:47:42 +0000 (20:47 -0400)
* linklist.{c,h}: (listnode_move_to_tail) new unction to move a
  listnode to tail of list.
* ospf_packet.c: (ospf_write) remove debug that seemed to be mostly covered
  by existing debug.
  Use listnode_move_to_tail to just move the list node to the end of the
  tail, rather than freeing the one to hand and allocing a new one.

lib/linklist.c
lib/linklist.h

index 370b2fa615e6aa7a1f6bb62e2592b84b55d4d352..4b16f07dd1c313c8d2113ceaa107b9ed219fc471 100644 (file)
@@ -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
index 88f4a0391209cf4e8c8506fe23f1833235bab2f4..6209c8b9d627e0c2a113f2eeed55670bd856f2e4 100644 (file)
@@ -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 *);