summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 75ba10dd..019b846e 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -219,6 +219,7 @@ proto_free_ahooks(struct proto *p)
p->main_ahook = NULL;
}
+
/**
* proto_config_new - create a new protocol configuration
* @pr: protocol the configuration will belong to
@@ -829,6 +830,9 @@ proto_schedule_feed(struct proto *p, int initial)
/* Connect protocol to routing table */
if (initial && !p->proto->multitable)
{
+ p->main_source = rt_get_source(p, 0);
+ rt_lock_source(p->main_source);
+
p->main_ahook = proto_add_announce_hook(p, p->table, &p->stats);
p->main_ahook->in_filter = p->cf->in_filter;
p->main_ahook->out_filter = p->cf->out_filter;
@@ -836,6 +840,7 @@ proto_schedule_feed(struct proto *p, int initial)
p->main_ahook->in_limit = p->cf->in_limit;
p->main_ahook->out_limit = p->cf->out_limit;
p->main_ahook->in_keep_filtered = p->cf->in_keep_filtered;
+
proto_reset_limit(p->main_ahook->rx_limit);
proto_reset_limit(p->main_ahook->in_limit);
proto_reset_limit(p->main_ahook->out_limit);
@@ -889,6 +894,8 @@ proto_flush_loop(void *unused UNUSED)
return;
}
+ rt_prune_sources();
+
again:
WALK_LIST(p, flush_proto_list)
if (p->flushing)
@@ -1086,6 +1093,12 @@ proto_notify_state(struct proto *p, unsigned ps)
if ((cs == FS_FEEDING) || (cs == FS_HAPPY))
proto_schedule_flush(p);
+ if (p->proto->multitable)
+ {
+ rt_unlock_source(p->main_source);
+ p->main_source = NULL;
+ }
+
neigh_prune(); // FIXME convert neighbors to resource?
rfree(p->pool);
p->pool = NULL;