summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-06-25 14:51:16 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-06-25 14:51:16 +0200
commit35f8c731ea29bd534c74b2d0de089d5683ebcd8d (patch)
tree677cffb254e9f2a8481b2f14fc937eee16b6f55f /proto/bgp/bgp.c
parentd8b5a786d27eed72106f88f893c521e67f1bef06 (diff)
Fixes output of BGP timers in 'show protocols all'.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 9c069b45..70c9b2f9 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1032,6 +1032,9 @@ bgp_get_status(struct proto *P, byte *buf)
bsprintf(buf, "%-14s%s%s", bgp_state_dsc(p), err1, err2);
}
+static inline bird_clock_t tm_remains(timer *t)
+{ return t->expires ? t->expires - now : 0; }
+
static void
bgp_show_proto_info(struct proto *P)
{
@@ -1074,10 +1077,10 @@ bgp_show_proto_info(struct proto *P)
if (p->cf->route_limit)
cli_msg(-1006, " Route limit: %d/%d",
p->p.stats.imp_routes, p->cf->route_limit);
- cli_msg(-1006, " Hold timer: %d/%d",
- c->hold_timer->expires - now, c->hold_time);
- cli_msg(-1006, " Keepalive timer: %d/%d",
- c->keepalive_timer->expires - now, c->keepalive_time);
+ cli_msg(-1006, " Hold timer: %d/%d",
+ tm_remains(c->hold_timer), c->hold_time);
+ cli_msg(-1006, " Keepalive timer: %d/%d",
+ tm_remains(c->keepalive_timer), c->keepalive_time);
}
if ((p->last_error_class != BE_NONE) &&