]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Don't log state changes if nothing user-visible has changed.
authorMartin Mares <mj@ucw.cz>
Tue, 16 May 2000 13:43:26 +0000 (13:43 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 16 May 2000 13:43:26 +0000 (13:43 +0000)
TODO
nest/proto.c
nest/protocol.h

diff --git a/TODO b/TODO
index c8fb0d1a4d597d0feead381655b4d1dac500f0a1..f2380b349f44d551fcc193b771fe68905770ff61 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,5 @@
 Core
 ~~~~
-- kernel: persistent mode
-
 - client: Ctrl-R eats one more enter
 - client: paging?
 - client: data losses on large dumps?
@@ -12,8 +10,6 @@ Core
 - bgp: timing of updates?
 - bgp: dump and get_route_info
 
-- proto: Don't show repeated `Changed state to ...' messages if only internal states change
-
 Documentation
 ~~~~~~~~~~~~~
 - write doctool
index dab40a6c5524f5e007a2feb4b2ebe5e9ce238598..e81aadc9979cd46e30d920abada8b945850b9f15 100644 (file)
@@ -59,7 +59,17 @@ proto_relink(struct proto *p)
 {
   list *l;
 
-  PD(p, "State changed to %s", proto_state_name(p));
+  if (p->debug & D_STATES)
+    {
+      char *name = proto_state_name(p);
+      if (name != p->last_state_name_announced)
+       {
+         p->last_state_name_announced = name;
+         PD(p, "State changed to %s", proto_state_name(p));
+       }
+    }
+  else
+    p->last_state_name_announced = NULL;
   rem_node(&p->n);
   switch (p->core_state)
     {
index f08b3bc3ad3b4730f5c9e51e96089a76261e597a..df9064b36f5161b47b441dfa2f486f576293b943 100644 (file)
@@ -107,6 +107,7 @@ struct proto {
   unsigned reconfiguring;              /* We're shutting down due to reconfiguration */
   u32 hash_key;                                /* Random key used for hashing of neighbors */
   bird_clock_t last_state_change;      /* Time of last state transition */
+  char *last_state_name_announced;     /* Last state name we've announced to the user */
 
   /*
    *   General protocol hooks: