isisd: fix circuit state machine
isisd has a so-called circuit state machine that takes care about
the interface state changes, such as initializing, down, up. When
an interface was brought down by a link failure, the interface
information was deleted and set to NULL. When the link was restored
later, the interface was looked up by the old pointer, but since it
was cleared, it was never found again, resulting in an interface
never entering the up state again.
Also, the program regularly crashed because of a deleted pointer in
the same context which was later accessed without any further
checking.
Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index aab8d1a..de34bea 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -172,7 +172,7 @@
circuit->upadjcount[level - 1]++;
if (state == ISIS_ADJ_DOWN)
{
- isis_delete_adj (adj, adj->circuit->u.bc.adjdb[level - 1]);
+ listnode_delete (adj->circuit->u.bc.adjdb[level - 1], adj);
circuit->upadjcount[level - 1]--;
}