aboutsummaryrefslogtreecommitdiffstats
path: root/proto/bfd
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-06-13 16:52:21 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:49:27 +0100
commitd3fa9e84e98d7b8c726f5e35d6a359971eb98f94 (patch)
tree686c3291ab9833972c06834f63e742272e904c0e /proto/bfd
parent212eda07c4e481e3341ede37b0877fa22bc042a4 (diff)
downloadbird-d3fa9e84e98d7b8c726f5e35d6a359971eb98f94.tar.gz
Timers: Show sub-second times in some protocol outputs
Diffstat (limited to 'proto/bfd')
-rw-r--r--proto/bfd/bfd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c
index 2374cfe8..8915140d 100644
--- a/proto/bfd/bfd.c
+++ b/proto/bfd/bfd.c
@@ -1078,7 +1078,7 @@ bfd_show_sessions(struct proto *P)
byte tbuf[TM_DATETIME_BUFFER_SIZE];
struct bfd_proto *p = (struct bfd_proto *) P;
uint state, diag UNUSED;
- u32 tx_int, timeout;
+ btime tx_int, timeout;
const char *ifname;
if (p->p.proto_state != PS_UP)
@@ -1099,15 +1099,14 @@ bfd_show_sessions(struct proto *P)
state = s->loc_state;
diag = s->loc_diag;
ifname = (s->ifa && s->ifa->iface) ? s->ifa->iface->name : "---";
- tx_int = s->last_tx ? (MAX(s->des_min_tx_int, s->rem_min_rx_int) TO_MS) : 0;
- timeout = (MAX(s->req_min_rx_int, s->rem_min_tx_int) TO_MS) * s->rem_detect_mult;
+ tx_int = s->last_tx ? MAX(s->des_min_tx_int, s->rem_min_rx_int) : 0;
+ timeout = (btime) MAX(s->req_min_rx_int, s->rem_min_tx_int) * s->rem_detect_mult;
state = (state < 4) ? state : 0;
tm_format_time(tbuf, &config->tf_proto, s->last_state_change);
- cli_msg(-1020, "%-25I %-10s %-10s %-10s %3u.%03u %3u.%03u",
- s->addr, ifname, bfd_state_names[state], tbuf,
- tx_int / 1000, tx_int % 1000, timeout / 1000, timeout % 1000);
+ cli_msg(-1020, "%-25I %-10s %-10s %-10s %7t %7t",
+ s->addr, ifname, bfd_state_names[state], tbuf, tx_int, timeout);
}
HASH_WALK_END;