diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-15 14:19:28 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-15 14:19:28 +0200 |
commit | f4ab23174688920e44bb4cae6e8b4f280a066e28 (patch) | |
tree | ab909b01b335fd865cd072f7bb74031fd8ab4ec4 | |
parent | cbfd671f114a96095f021662ad1cf0eaa6d089c1 (diff) | |
download | bird-f4ab23174688920e44bb4cae6e8b4f280a066e28.tar bird-f4ab23174688920e44bb4cae6e8b4f280a066e28.zip |
bgp_get_status: If protocol is down, don't print BGP state.
-rw-r--r-- | TODO | 6 | ||||
-rw-r--r-- | proto/bgp/bgp.c | 5 |
2 files changed, 5 insertions, 6 deletions
@@ -1,13 +1,10 @@ Core ~~~~ -- config: try to unify expressions - -- static: check validity of route destination? - - configure: default CFLAGS? - filters: deletion of mandatory attributes? - filters: user defined attributes? +- filters: arithmetics and define'd symbols - kernel: persistent mode @@ -22,7 +19,6 @@ Core - bgp: timing of updates? - bgp: dump and get_route_info -- bgp: when protocol is down, don't print Idle state - proto: Don't show repeated `Changed state to ...' messages if only internal states change diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 98eb003..c6dc4e9 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -503,7 +503,10 @@ bgp_get_status(struct proto *P, byte *buf) { struct bgp_proto *p = (struct bgp_proto *) P; - strcpy(buf, bgp_state_names[MAX(p->incoming_conn.state, p->outgoing_conn.state)]); + if (P->proto_state == PS_DOWN) + buf[0] = 0; + else + strcpy(buf, bgp_state_names[MAX(p->incoming_conn.state, p->outgoing_conn.state)]); } static int |