diff --git a/filter/trie.c b/filter/trie.c index 12ba0b82..0bfbfdd6 100644 --- a/filter/trie.c +++ b/filter/trie.c @@ -496,6 +496,7 @@ trie_add_prefix(struct f_trie *t, const net_addr *net, uint l, uint h) static int trie_match_net4(const struct f_trie *t, ip4_addr px, uint plen) { + log("net4 compare"); if (plen == 0) return t->zero; @@ -532,6 +533,7 @@ trie_match_net4(const struct f_trie *t, ip4_addr px, uint plen) static int trie_match_net6(const struct f_trie *t, ip6_addr px, uint plen) { + log("net6 compare"); if (plen == 0) return t->zero; @@ -577,6 +579,7 @@ trie_match_net6(const struct f_trie *t, ip6_addr px, uint plen) int trie_match_net(const struct f_trie *t, const net_addr *n) { + log(L_DEBUG "trie match net - types %i %i", t->ipv4, n->type); switch (n->type) { case NET_IP4: diff --git a/nest/proto.c b/nest/proto.c index 318aaac4..34cbbfcb 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -754,7 +754,7 @@ channel_refeed_prefilter(const struct rt_prefilter *p, const net_addr *n) SKIP_BACK(struct channel, refeed_req, SKIP_BACK(struct rt_export_request, prefilter, p) ); - + ASSERT_DIE(c->refeeding); for (struct channel_feeding_request *cfr = c->refeeding; cfr; cfr = cfr->next) if (!cfr->trie || trie_match_net(cfr->trie, n)) { @@ -772,12 +772,16 @@ channel_import_prefilter(const struct rt_prefilter *p, const net_addr *n) SKIP_BACK(struct channel, reload_req, SKIP_BACK(struct rt_export_request, prefilter, p) ); + ASSERT_DIE(c->importing); for (struct channel_import_request *cir = c->importing; cir; cir = cir->next) + { + log(L_DEBUG "in for cycle %x %x", cir->trie, cir->trie->root); if (!cir->trie || trie_match_net(cir->trie, n)) { log(L_TRACE "Export this one"); return 1; } + } log(L_TRACE "%N filtered out of import", n); return 0; } @@ -839,22 +843,24 @@ channel_schedule_reload(struct channel *c, struct channel_import_request *cir) int no_trie = 0; if (cir) { - struct channel_import_request* last = c->import_pending; - while (last) - { - if (!last->trie) - no_trie = 1; - last = last->next; - } - last = cir; - no_trie = !last->trie; + cir->next = c->import_pending; + c->import_pending = cir; } + if (c->reload_req.hook) { CD(c, "Reload triggered before the previous one has finished"); c->reload_pending = 1; return; } + struct channel_import_request *last = cir; + while (last) + { + if (!last->trie) + no_trie = 1; + last = last->next; + } + c->importing = c->import_pending; c->import_pending = NULL; diff --git a/nest/rt-table.c b/nest/rt-table.c index 5cf7b2ee..668ee747 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2212,7 +2212,6 @@ rt_table_export_start_feed(struct rtable_private *tab, struct rt_table_export_ho { struct rt_exporter *re = &tab->exporter.e; struct rt_export_request *req = hook->h.req; - log("Hook is %x", hook); /* stats zeroed by mb_allocz */ switch (req->prefilter.mode) { @@ -2230,7 +2229,6 @@ rt_table_export_start_feed(struct rtable_private *tab, struct rt_table_export_ho case TE_ADDR_NONE: case TE_ADDR_TRIE: case TE_ADDR_HOOK: - log(L_TRACE "hook - we will feed by fib, not trie?"); FIB_ITERATE_INIT(&hook->feed_fit, &tab->fib); hook->h.event.hook = rt_feed_by_fib; break; @@ -4418,8 +4416,10 @@ rt_feed_by_fib(void *data) { if (rt_prefilter_net(&c->h.req->prefilter, n->n.addr)) { + log("route passed"); if (!rt_prepare_feed(c, n, &block)) { + log("inside ifs"); FIB_ITERATE_PUT(fit); RT_UNLOCK(tab); rt_process_feed(c, &block);