summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-12-10 22:30:46 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2013-12-10 22:30:46 +0100
commit6601a14831cdd32fc671ebc9dc299d2be427e489 (patch)
tree00b89854e36fbecd17443d09587c7cd80352893f /nest/proto.c
parent2d0b7e24a52d51904faa8a8e96d68863491c110a (diff)
parent283c7dfada53a6dee6a8a17ecab492ffafd44b66 (diff)
Merge branch 'add-path'
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 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;