summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfctl
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-02-19 10:35:53 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-02-19 10:35:53 +0000
commitc7e23a3386688c502957b025f81b43d39dbef10a (patch)
tree47d9826536c432d68d3637a0767721f9dd693d8c /usr.sbin/ospfctl
parentfbd811739ba75515c19bff2c032f88ede4e82d0a (diff)
implement ospfctl fib reload.
this tells the daemon to resync the kernels list of interfaces and routes with the daemons list. this is very useful if the routing socket overflows and you want to sync things up again. lots and lots of help from claudio@ ok claudio@
Diffstat (limited to 'usr.sbin/ospfctl')
-rw-r--r--usr.sbin/ospfctl/ospfctl.87
-rw-r--r--usr.sbin/ospfctl/ospfctl.c8
-rw-r--r--usr.sbin/ospfctl/parser.c3
-rw-r--r--usr.sbin/ospfctl/parser.h3
4 files changed, 16 insertions, 5 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.8 b/usr.sbin/ospfctl/ospfctl.8
index 37bb63b5c71..b2dc19d0e7f 100644
--- a/usr.sbin/ospfctl/ospfctl.8
+++ b/usr.sbin/ospfctl/ospfctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ospfctl.8,v 1.24 2009/11/03 08:09:15 jmc Exp $
+.\" $OpenBSD: ospfctl.8,v 1.25 2010/02/19 10:35:52 dlg Exp $
.\"
.\" Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 3 2009 $
+.Dd $Mdocdate: February 19 2010 $
.Dt OSPFCTL 8
.Os
.Sh NAME
@@ -54,6 +54,9 @@ a.k.a. the kernel routing table.
Decoupling the FIB from an OSPF router may create routing loops and could cause
major routing issues in the complete OSPF cloud.
Only routers with just one link to the OSPF cloud can safely decouple the FIB.
+.It Cm fib reload
+Refetches and relearns the routes in the Forwarding Information Base
+a.k.a. the kernel routing table.
.It Cm log brief
Disable verbose debug logging.
.It Cm log verbose
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c
index ecdb2d9e78e..120a12f1971 100644
--- a/usr.sbin/ospfctl/ospfctl.c
+++ b/usr.sbin/ospfctl/ospfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfctl.c,v 1.52 2010/02/16 08:39:05 dlg Exp $ */
+/* $OpenBSD: ospfctl.c,v 1.53 2010/02/19 10:35:52 dlg Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -220,6 +220,11 @@ main(int argc, char *argv[])
printf("decouple request sent.\n");
done = 1;
break;
+ case FIB_RELOAD:
+ imsg_compose(ibuf, IMSG_CTL_FIB_RELOAD, 0, 0, -1, NULL, 0);
+ printf("reload request sent.\n");
+ done = 1;
+ break;
case LOG_VERBOSE:
verbose = 1;
/* FALLTHROUGH */
@@ -296,6 +301,7 @@ main(int argc, char *argv[])
case FIB:
case FIB_COUPLE:
case FIB_DECOUPLE:
+ case FIB_RELOAD:
case LOG_VERBOSE:
case LOG_BRIEF:
case RELOAD:
diff --git a/usr.sbin/ospfctl/parser.c b/usr.sbin/ospfctl/parser.c
index 42717e9e330..314ec0ffa33 100644
--- a/usr.sbin/ospfctl/parser.c
+++ b/usr.sbin/ospfctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.17 2009/11/13 20:09:54 jsg Exp $ */
+/* $OpenBSD: parser.c,v 1.18 2010/02/19 10:35:52 dlg Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -71,6 +71,7 @@ static const struct token t_main[] = {
static const struct token t_fib[] = {
{ KEYWORD, "couple", FIB_COUPLE, NULL},
{ KEYWORD, "decouple", FIB_DECOUPLE, NULL},
+ { KEYWORD, "reload", FIB_RELOAD, NULL},
{ ENDTOKEN, "", NONE, NULL}
};
diff --git a/usr.sbin/ospfctl/parser.h b/usr.sbin/ospfctl/parser.h
index d3366431a24..28676039257 100644
--- a/usr.sbin/ospfctl/parser.h
+++ b/usr.sbin/ospfctl/parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.h,v 1.10 2009/11/13 20:09:54 jsg Exp $ */
+/* $OpenBSD: parser.h,v 1.11 2010/02/19 10:35:52 dlg Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -29,6 +29,7 @@ enum actions {
FIB,
FIB_COUPLE,
FIB_DECOUPLE,
+ FIB_RELOAD,
LOG_VERBOSE,
LOG_BRIEF,
SHOW,