summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-11-29 22:01:33 +0000
committerMartin Mares <mj@ucw.cz>1998-11-29 22:01:33 +0000
commit66efdf962a343c7cf5aef475f35f9e3864cb4fdd (patch)
tree36745598abcfa9590f3e1030fd20f767f53ca2cb
parented45f2e126680c7197be2058f9c162f1d5019eeb (diff)
Handle disabled protocol instances.
-rw-r--r--nest/proto.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 6aa83990..cb9b8440 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -25,10 +25,9 @@ list inactive_proto_list;
void *
proto_new(struct protocol *pr, unsigned size)
{
- struct proto *p = mp_alloc(cfg_mem, size);
+ struct proto *p = cfg_allocz(size);
debug("proto_new(%s)\n", pr->name);
- bzero(p, sizeof(*p));
p->proto = pr;
p->name = pr->name;
p->debug = pr->debug;
@@ -71,6 +70,8 @@ static void
proto_start(struct proto *p)
{
rem_node(&p->n);
+ if (p->disabled)
+ return;
p->state = PRS_STARTING;
if (p->start)
p->start(p);
@@ -103,7 +104,9 @@ protos_dump_all(void)
WALK_LIST(p, proto_list)
{
debug(" protocol %s:\n", p->name);
- if (p->dump)
+ if (p->disabled)
+ debug("\tDISABLED\n");
+ else if (p->dump)
p->dump(p);
}
WALK_LIST(p, inactive_proto_list)