summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfctl
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-02-16 08:39:06 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-02-16 08:39:06 +0000
commitbe5c5edbf390cc04a11dddd20cbf3d5251afc6b7 (patch)
treee6c8838676aaeac241ea2f37c4de59ea9dcc8bd5 /usr.sbin/ospfctl
parentf8705765f4e91d61e6ae819383ee511c58d0613b (diff)
implement support for fast hello packets.
if route-dead-time is set to "minimal" (rather than a number of seconds), the dead time is set to 1 second and hellos are sent at the interval specified by fast-hello-interval in msecs. this is non standard wrt to the ospf rfc, but it does interoperate with at least one other router vendor. this allows much better responsiveness to l3 topology changes than the standard intervals allow. if i yank a cable to one of my upstreams, the routes adjust in a second rather than the default of 40 i was running with before. the users dont even notice something changed. developed while working with joshua atterbury. ok claudio@ as part of a larger diff. dedicated to zan rowe who thinks she is a bigger nerd than me.
Diffstat (limited to 'usr.sbin/ospfctl')
-rw-r--r--usr.sbin/ospfctl/ospfctl.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c
index 0350734c6d2..ecdb2d9e78e 100644
--- a/usr.sbin/ospfctl/ospfctl.c
+++ b/usr.sbin/ospfctl/ospfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfctl.c,v 1.51 2010/02/16 08:22:42 dlg Exp $ */
+/* $OpenBSD: ospfctl.c,v 1.52 2010/02/16 08:39:05 dlg Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -386,8 +386,8 @@ show_interface_msg(struct imsg *imsg)
err(1, NULL);
printf("%-11s %-18s %-6s %-10s %-10s %s %3d %3d\n",
iface->name, netid, if_state_name(iface->state),
- iface->hello_timer < 0 ? "-" :
- fmt_timeframe_core(iface->hello_timer),
+ iface->hello_timer.tv_sec < 0 ? "-" :
+ fmt_timeframe_core(iface->hello_timer.tv_sec),
get_linkstate(iface->mediatype, iface->linkstate),
fmt_timeframe_core(iface->uptime),
iface->nbr_cnt, iface->adj_cnt);
@@ -432,17 +432,26 @@ show_interface_detail_msg(struct imsg *imsg)
printf(" Backup Designated Router (ID) %s, ",
inet_ntoa(iface->bdr_id));
printf("interface address %s\n", inet_ntoa(iface->bdr_addr));
- printf(" Timer intervals configured, "
- "hello %d, dead %d, wait %d, retransmit %d\n",
- iface->hello_interval, iface->dead_interval,
- iface->dead_interval, iface->rxmt_interval);
+ if (iface->dead_interval == FAST_RTR_DEAD_TIME) {
+ printf(" Timer intervals configured, "
+ "hello %d msec, dead %d, wait %d, retransmit %d\n",
+ iface->fast_hello_interval, iface->dead_interval,
+ iface->dead_interval, iface->rxmt_interval);
+
+ } else {
+ printf(" Timer intervals configured, "
+ "hello %d, dead %d, wait %d, retransmit %d\n",
+ iface->hello_interval, iface->dead_interval,
+ iface->dead_interval, iface->rxmt_interval);
+ }
if (iface->passive)
printf(" Passive interface (No Hellos)\n");
- else if (iface->hello_timer < 0)
+ else if (iface->hello_timer.tv_sec < 0)
printf(" Hello timer not running\n");
else
- printf(" Hello timer due in %s\n",
- fmt_timeframe_core(iface->hello_timer));
+ printf(" Hello timer due in %s+%ldmsec\n",
+ fmt_timeframe_core(iface->hello_timer.tv_sec),
+ iface->hello_timer.tv_usec / 1000);
printf(" Uptime %s\n", fmt_timeframe_core(iface->uptime));
printf(" Neighbor count is %d, adjacent neighbor count is "
"%d\n", iface->nbr_cnt, iface->adj_cnt);