]> git.puffer.fish Git - mirror/frr.git/commit
lib: don't create circular lists (fixes 6d83113)
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 12 Dec 2014 20:35:28 +0000 (21:35 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:24:51 +0000 (15:24 +0000)
commitde111d75a97e18bcbe048d070584ad06eff42f1d
tree308294006a5814ef742f19e47fbb8795bd1ac41d
parent37da8fa9a2b8e69c68241ecbf72a4976e48e8e1f
lib: don't create circular lists (fixes 6d83113)

LISTNODE_DETACH doesn't clear out the node, and LISTNODE_ATTACH doesn't
set ->next (since it assumes a fresh/zeroed listnode).  As a result, the
new listnode_move_to_tail() created a nice circular list, in turn
crashing ospfd in ospf_write() later.

Reported-by: Martin Winter <mwinter@netdef.org>
Fixes: 6d83113 ("ospfd: Tweak previous iface RR write patch to avoid free/malloc & redundant log")
Cc: Paul Jakma <paul@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
(cherry picked from commit 1c6db0d2da34044ddfb42665fda8a3387ecc451d)
lib/linklist.h