summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-01-12 14:06:49 +0100
committerMaria Matejka <mq@ucw.cz>2022-02-03 10:30:33 +0100
commitb6c9263543060141d79e205e1b3408099ad1afc4 (patch)
treebada190f4106905ebfd638a1777c8fb255c0e9f9 /nest/proto.c
parentb5155d5cea6af783619144ca49648ad743cf4e38 (diff)
Interfaces and neighbor notifications do properly enter protocol loops
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 341581ab..1e7f5560 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -70,17 +70,6 @@ static inline event_list *proto_work_list(struct proto *p)
static inline void proto_send_event(struct proto *p)
{ ev_send(proto_event_list(p), p->event); }
-#define PROTO_ENTER_FROM_MAIN(p) ({ \
- ASSERT_DIE(birdloop_inside(&main_birdloop)); \
- struct birdloop *_loop = (p)->loop; \
- if (_loop != &main_birdloop) birdloop_enter(_loop); \
- _loop; \
- })
-
-#define PROTO_LEAVE_FROM_MAIN(loop) ({ if (loop != &main_birdloop) birdloop_leave(loop); })
-
-#define PROTO_LOCKED_FROM_MAIN(p) for (struct birdloop *_proto_loop = PROTO_ENTER_FROM_MAIN(p); _proto_loop; PROTO_LEAVE_FROM_MAIN(_proto_loop), (_proto_loop = NULL))
-
static inline int channel_is_active(struct channel *c)
{ return (c->channel_state != CS_DOWN); }
@@ -2389,6 +2378,8 @@ static struct rte_owner_class default_rte_owner_class;
static inline void
proto_do_start(struct proto *p)
{
+ ASSERT_DIE(birdloop_inside(p->loop));
+
p->active = 1;
rt_init_sources(&p->sources, p->name, proto_work_list(p));
@@ -2402,6 +2393,8 @@ proto_do_start(struct proto *p)
static void
proto_do_up(struct proto *p)
{
+ ASSERT_DIE(birdloop_inside(p->loop));
+
if (!p->main_source)
p->main_source = rt_get_source(p, 0);
// Locked automaticaly