summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-13 13:01:41 +0200
committerMartin Mares <mj@ucw.cz>2000-05-13 13:01:41 +0200
commite4bfafa1008918cf904ede023feb18fa4cb7d524 (patch)
tree7a3d8977027b71648883726e123eb0a098881ee2 /proto
parent08f0290a1ebf94624c4eb4cbcb10e2b35a846432 (diff)
downloadbird-e4bfafa1008918cf904ede023feb18fa4cb7d524.tar
bird-e4bfafa1008918cf904ede023feb18fa4cb7d524.zip
Manual enable/disable works right.
Diffstat (limited to 'proto')
-rw-r--r--proto/static/static.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/proto/static/static.c b/proto/static/static.c
index 7df62ed..c380aeb 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -65,6 +65,7 @@ static_remove(struct proto *p, struct static_route *r)
static void
static_add(struct proto *p, struct static_route *r)
{
+ DBG("static_add(%I/%d,%d)\n", r->net, r->masklen, r->dest);
switch (r->dest)
{
case RTD_ROUTER:
@@ -101,6 +102,20 @@ static_start(struct proto *p)
return PS_UP;
}
+static int
+static_shutdown(struct proto *p)
+{
+ struct static_config *c = (void *) p->cf;
+ struct static_route *r;
+
+ DBG("Static: prepare for landing!\n");
+ WALK_LIST(r, c->iface_routes)
+ static_remove(p, r);
+ WALK_LIST(r, c->other_routes)
+ static_remove(p, r);
+ return PS_DOWN;
+}
+
static void
static_neigh_notify(struct neighbor *n)
{
@@ -250,6 +265,7 @@ struct protocol proto_static = {
init: static_init,
dump: static_dump,
start: static_start,
+ shutdown: static_shutdown,
reconfigure: static_reconfigure,
};