0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Manual enable/disable works right.

This commit is contained in:
Martin Mares 2000-05-13 11:01:41 +00:00
parent 08f0290a1e
commit e4bfafa100

View File

@ -65,6 +65,7 @@ static_remove(struct proto *p, struct static_route *r)
static void static void
static_add(struct proto *p, struct static_route *r) 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) switch (r->dest)
{ {
case RTD_ROUTER: case RTD_ROUTER:
@ -101,6 +102,20 @@ static_start(struct proto *p)
return PS_UP; 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 void
static_neigh_notify(struct neighbor *n) static_neigh_notify(struct neighbor *n)
{ {
@ -250,6 +265,7 @@ struct protocol proto_static = {
init: static_init, init: static_init,
dump: static_dump, dump: static_dump,
start: static_start, start: static_start,
shutdown: static_shutdown,
reconfigure: static_reconfigure, reconfigure: static_reconfigure,
}; };