]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes bug in protocol state machine
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 12 Feb 2009 12:43:06 +0000 (13:43 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 12 Feb 2009 12:43:06 +0000 (13:43 +0100)
Scheduling flush must be done before resource pool freeing as it
frees some allocated list nodes from a global list.

nest/proto.c

index 2e1eb8f00dcdcadf0525c14b0ae1d749fe23fe82..0ad7229cdc01600cdafaf2775bc92e6717baa4d9 100644 (file)
@@ -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);