]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Manual enable/disable works right.
authorMartin Mares <mj@ucw.cz>
Sat, 13 May 2000 11:01:41 +0000 (11:01 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 13 May 2000 11:01:41 +0000 (11:01 +0000)
proto/static/static.c

index 7df62ed0c4591a02376301d5a237b0f3959f1adc..c380aeb26c6f3b6b007351944bd9e7815a29454a 100644 (file)
@@ -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,
 };