diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-16 15:43:26 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-16 15:43:26 +0200 |
commit | df9f0fb30a7046872eff21624a315d5fd56e938f (patch) | |
tree | 7ae96014fc94ba23ea640db451ca90da738d4e87 /nest | |
parent | f990fc61e0dd13ae90c9bbff811736dfd52988b0 (diff) | |
download | bird-df9f0fb30a7046872eff21624a315d5fd56e938f.tar bird-df9f0fb30a7046872eff21624a315d5fd56e938f.zip |
Don't log state changes if nothing user-visible has changed.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/proto.c | 12 | ||||
-rw-r--r-- | nest/protocol.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/nest/proto.c b/nest/proto.c index dab40a6..e81aadc 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -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) { diff --git a/nest/protocol.h b/nest/protocol.h index f08b3bc..df9064b 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -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: |