bgp_get_status: If protocol is down, don't print BGP state.

This commit is contained in:
Martin Mares 2000-05-15 12:19:28 +00:00
parent cbfd671f11
commit f4ab231746
2 changed files with 5 additions and 6 deletions

6
TODO
View file

@ -1,13 +1,10 @@
Core Core
~~~~ ~~~~
- config: try to unify expressions
- static: check validity of route destination?
- configure: default CFLAGS? - configure: default CFLAGS?
- filters: deletion of mandatory attributes? - filters: deletion of mandatory attributes?
- filters: user defined attributes? - filters: user defined attributes?
- filters: arithmetics and define'd symbols
- kernel: persistent mode - kernel: persistent mode
@ -22,7 +19,6 @@ Core
- bgp: timing of updates? - bgp: timing of updates?
- bgp: dump and get_route_info - 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 - proto: Don't show repeated `Changed state to ...' messages if only internal states change

View file

@ -503,6 +503,9 @@ bgp_get_status(struct proto *P, byte *buf)
{ {
struct bgp_proto *p = (struct bgp_proto *) P; struct bgp_proto *p = (struct bgp_proto *) P;
if (P->proto_state == PS_DOWN)
buf[0] = 0;
else
strcpy(buf, bgp_state_names[MAX(p->incoming_conn.state, p->outgoing_conn.state)]); strcpy(buf, bgp_state_names[MAX(p->incoming_conn.state, p->outgoing_conn.state)]);
} }