extern linpool *rte_update_pool;
+static void aggregator_bucket_update(struct aggregator_proto *p, struct aggregator_bucket *bucket, struct network *net);
+
static inline int
is_leaf(const struct trie_node *node)
{
}
HASH_WALK_END;
- ev_schedule(&p->reload_trie);
-
- /* Announce changes */
- if (old_bucket)
- aggregator_bucket_update(p, old_bucket, net);
+ if (p->net_present == 0)
+ ev_schedule(&p->reload_trie);
+ else
+ {
+ /* Announce changes */
+ if (old_bucket)
+ aggregator_bucket_update(p, old_bucket, net);
- if (new_bucket && (new_bucket != old_bucket))
- aggregator_bucket_update(p, new_bucket, net);
+ if (new_bucket && (new_bucket != old_bucket))
+ aggregator_bucket_update(p, new_bucket, net);
+ }
/* Cleanup the old bucket if empty */
if (old_bucket && (!old_bucket->rte || !old_bucket->count))
p->aggr_on_count = cf->aggr_on_count;
p->aggr_on_da_count = cf->aggr_on_da_count;
p->aggr_on = cf->aggr_on;
+ p->net_present = cf->net_present;
p->merge_by = cf->merge_by;
P->rt_notify = aggregator_rt_notify;
if (AGGREGATOR_CFG->aggr_on)
cf_error("Only one aggregate on clause allowed");
+ AGGREGATOR_CFG->net_present = 0;
int count = 0;
for (const struct aggr_item_node *item = $3; item; item = item->next) {
log(L_WARN "type %d sacode %d", item->i.type, item->i.sa.sa_code);
+
+ if (item->i.type == AGGR_ITEM_STATIC_ATTR && item->i.sa.sa_code == SA_NET)
+ AGGREGATOR_CFG->net_present = 1;
+
count++;
}