Revision 54aaa89a

View differences:

nest/proto.c
199 199
  q->core_state = FS_HUNGRY;
200 200
  proto_enqueue(&initial_proto_list, q);
201 201
  add_tail(&proto_list, &q->glob_node);
202
  /*
203
   *  HACK ALERT!  In case of multiple kernel routing tables,
204
   *  the kernel syncer acts as multiple protocols which cooperate
205
   *  with each other.  In order to speed up their initialization,
206
   *  we need to know when we're initializing the last one, hence
207
   *  the startup counter.
208
   */
209
  if (!q->disabled)
210
    p->startup_counter++;
211 202
  return q;
212 203
}
213 204

  
......
310 301
      if (p->core_state == FS_HUNGRY && p->proto_state == PS_DOWN)
311 302
	{
312 303
	  DBG("Kicking %s up\n", p->name);
313
	  if (q->startup_counter > 0)	/* FIXME: Kill the startup counter hack! */
314
	    q->startup_counter--;
315 304
	  proto_init_instance(p);
316 305
	  proto_notify_state(p, (q->start ? q->start(p) : PS_UP));
317 306
	}
nest/protocol.h
37 37
  unsigned debug;			/* Default debugging flags */
38 38
  int priority;				/* Protocol priority (usually 0) */
39 39
  int name_counter;			/* Counter for automatic name generation */
40
  int startup_counter;			/* Number of instances waiting for initialization */
41 40

  
42 41
  void (*preconfig)(struct protocol *, struct config *);	/* Just before configuring */
43 42
  void (*postconfig)(struct proto_config *);			/* After configuring each instance */

Also available in: Unified diff