diff options
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nest/proto.c b/nest/proto.c index 5876e5d4..cfa6ff4b 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -218,6 +218,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 @@ -830,6 +831,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; @@ -837,6 +841,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); @@ -890,6 +895,8 @@ proto_flush_loop(void *unused UNUSED) return; } + rt_prune_sources(); + again: WALK_LIST(p, flush_proto_list) if (p->flushing) @@ -1088,6 +1095,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; |