summaryrefslogtreecommitdiffstats
path: root/lib/linklist.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@opensourcerouting.org>2014-10-09 17:05:15 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-05-30 02:47:42 +0200
commit93559b99b0215e57476ca10d623cfbb4058a1db2 (patch)
treea9c3ee6f0c7cdbf8f82912b86996f04dd1febcbe /lib/linklist.c
parentbgpd: Fix useless call in bgpd/bgp_mplsvpn.c (diff)
downloadfrr-93559b99b0215e57476ca10d623cfbb4058a1db2.tar.xz
frr-93559b99b0215e57476ca10d623cfbb4058a1db2.zip
ospfd: Tweak previous iface RR write patch to avoid free/malloc & redundant log
* 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.
Diffstat (limited to 'lib/linklist.c')
-rw-r--r--lib/linklist.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/linklist.c b/lib/linklist.c
index 370b2fa61..4b16f07dd 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