summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-10-22 21:03:25 +0200
committerMaria Matejka <mq@ucw.cz>2021-11-22 19:05:43 +0100
commit445eeaf3df126af2c7b61e71c4f08a583eb4fa60 (patch)
treeb615c8df1a41248cb6b945244a6bff37904a226a /nest/proto.c
parent6e841b3153565632b6753f6b1fe74850c37f2808 (diff)
Split route table event into separate events
The former rt_event is dropped in favour of separate table events. This allows for selective corking of NHU and prune.
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/nest/proto.c b/nest/proto.c
index ac0fb232..f8e1ba31 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -658,6 +658,8 @@ channel_aux_stopped(void *data)
else
c->in_table = NULL;
+ rfree(cat->tab->rp);
+
mb_free(cat);
return channel_check_stopped(c);
}
@@ -666,7 +668,7 @@ static void
channel_aux_import_stopped(struct rt_import_request *req)
{
struct channel_aux_table *cat = SKIP_BACK(struct channel_aux_table, push, req);
- ASSERT_DIE(cat->stop);
+ ASSERT_DIE(cat->tab->delete_event);
}
static void
@@ -675,25 +677,23 @@ channel_aux_export_stopped(struct rt_export_request *req)
struct channel_aux_table *cat = SKIP_BACK(struct channel_aux_table, get, req);
req->hook = NULL;
- if (cat->refeed_pending && !cat->stop)
+ if (cat->refeed_pending && !cat->tab->delete_event)
{
cat->refeed_pending = 0;
rt_request_export(cat->tab, req);
}
else
- ASSERT_DIE(cat->stop);
+ ASSERT_DIE(cat->tab->delete_event);
}
static void
channel_aux_stop(struct channel_aux_table *cat)
{
- cat->stop = 1;
-
rt_stop_import(&cat->push, channel_aux_import_stopped);
rt_stop_export(&cat->get, channel_aux_export_stopped);
- cat->tab->deleted = channel_aux_stopped;
- cat->tab->del_data = cat;
+ cat->tab->delete_event = ev_new_init(cat->tab->rp, channel_aux_stopped, cat);
+
rt_unlock_table(cat->tab);
}
@@ -886,7 +886,6 @@ channel_setup_in_table(struct channel *c, int best)
c->in_table->c = c;
c->in_table->tab = rt_setup(c->proto->pool, &cat->tab_cf);
- self_link(&c->in_table->tab->n);
rt_lock_table(c->in_table->tab);
rt_request_import(c->in_table->tab, &c->in_table->push);
@@ -929,7 +928,6 @@ channel_setup_out_table(struct channel *c)
c->out_table->c = c;
c->out_table->tab = rt_setup(c->proto->pool, &cat->tab_cf);
- self_link(&c->out_table->tab->n);
rt_lock_table(c->out_table->tab);
rt_request_import(c->out_table->tab, &c->out_table->push);