summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/kroute.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-24 19:59:25 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-24 19:59:25 +0000
commit773b2797d0667b7493ddae968f2d78e5b54c673d (patch)
tree1ae1c8a3de5b2be384c0dac0550cadc6dd8d3190 /usr.sbin/bgpd/kroute.c
parent57a2ceca5c5933da9b07fcc2cc03aa5d52102f02 (diff)
now that we keep track of the routes we added to the kernel we can remove
them easily on shutdown without the RDE's help
Diffstat (limited to 'usr.sbin/bgpd/kroute.c')
-rw-r--r--usr.sbin/bgpd/kroute.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index 77de2cf9255..1359ff9614c 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.6 2003/12/24 19:23:26 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.7 2003/12/24 19:59:24 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -214,3 +214,13 @@ kroute_compare(struct kroute_node *a, struct kroute_node *b)
return (1);
return (0);
}
+
+void
+kroute_shutdown(int fd)
+{
+ struct kroute_node *kr;
+
+ RB_FOREACH(kr, kroute_tree, &krt)
+ if ((kr->flags & F_BGPD_INSERTED))
+ kroute_msg(fd, RTM_DELETE, &kr->r);
+}