summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfctl
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-02-16 08:39:05 +0000
committerdlg <dlg@openbsd.org>2010-02-16 08:39:05 +0000
commit7afdfd2dfa39cfe53336ddae9f26473ba4897e87 (patch)
treeb067791e8327ff3842c70b490a26e0c216cf75d9 /usr.sbin/ospfctl
parentdefault verbosity to 4 (diff)
downloadwireguard-openbsd-7afdfd2dfa39cfe53336ddae9f26473ba4897e87.tar.xz
wireguard-openbsd-7afdfd2dfa39cfe53336ddae9f26473ba4897e87.zip
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);