]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Last state change should track protocol state change.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 24 Nov 2013 21:22:24 +0000 (22:22 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 24 Nov 2013 21:22:24 +0000 (22:22 +0100)
And not core state change, which is not much relevant
(e.g. refeed in BGP).

nest/proto.c

index 75ba10dd9c8852bbb00b6b372d83adeefb4dbb2d..5876e5d48400aa169bc2dcde74318288929af714 100644 (file)
@@ -48,7 +48,6 @@ static void
 proto_enqueue(list *l, struct proto *p)
 {
   add_tail(l, &p->n);
-  p->last_state_change = now;
 }
 
 static void
@@ -362,6 +361,8 @@ proto_init(struct proto_config *c)
 
   q->proto_state = PS_DOWN;
   q->core_state = FS_HUNGRY;
+  q->last_state_change = now;
+
   proto_enqueue(&initial_proto_list, q);
   if (p == &proto_unix_iface)
     initial_device_proto = q;
@@ -1077,6 +1078,7 @@ proto_notify_state(struct proto *p, unsigned ps)
     return;
 
   p->proto_state = ps;
+  p->last_state_change = now;
 
   switch (ps)
     {