summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-02-12 13:43:06 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-02-12 13:43:06 +0100
commitb807ef9a15db2a5db14f68011923975dfc472f49 (patch)
treee160226a5dcc52694e59fd6680c1d5841b6c1523
parent80ac7dc18145baa04a05eee3a69d325087cb9472 (diff)
downloadbird-b807ef9a15db2a5db14f68011923975dfc472f49.tar
bird-b807ef9a15db2a5db14f68011923975dfc472f49.zip
Fixes bug in protocol state machine
Scheduling flush must be done before resource pool freeing as it frees some allocated list nodes from a global list.
-rw-r--r--nest/proto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 2e1eb8f..0ad7229 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -605,6 +605,9 @@ proto_notify_state(struct proto *p, unsigned ps)
switch (ps)
{
case PS_DOWN:
+ if ((cs = FS_FEEDING) || (cs == FS_HAPPY))
+ proto_schedule_flush(p);
+
neigh_prune(); // FIXME convert neighbors to resource?
rfree(p->pool);
p->pool = NULL;
@@ -614,9 +617,6 @@ proto_notify_state(struct proto *p, unsigned ps)
proto_fell_down(p);
return; /* The protocol might have ceased to exist */
}
- /* Otherwise, we have something to flush... */
- else if (cs != FS_FLUSHING)
- proto_schedule_flush(p);
break;
case PS_START:
ASSERT(ops == PS_DOWN);