summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-15 12:19:28 +0000
committerMartin Mares <mj@ucw.cz>2000-05-15 12:19:28 +0000
commitf4ab23174688920e44bb4cae6e8b4f280a066e28 (patch)
treeab909b01b335fd865cd072f7bb74031fd8ab4ec4 /proto/bgp/bgp.c
parentcbfd671f114a96095f021662ad1cf0eaa6d089c1 (diff)
bgp_get_status: If protocol is down, don't print BGP state.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 98eb003e..c6dc4e90 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