mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-11 17:08:46 +00:00
Channel: Replacing refeed status trie by bitmap
This fixes a bug with reloading non-IP channels.
This commit is contained in:
parent
548dbb2252
commit
e4e90c6f4d
@ -705,6 +705,7 @@ channel_start_export(struct channel *c)
|
||||
|
||||
bmap_init(&c->export_map, p, 16);
|
||||
bmap_init(&c->export_reject_map, p, 16);
|
||||
bmap_init(&c->refeed_map, p, 16);
|
||||
|
||||
channel_reset_limit(c, &c->out_limit, PLD_OUT);
|
||||
|
||||
@ -791,6 +792,7 @@ channel_export_stopped(struct rt_export_request *req)
|
||||
|
||||
bmap_reset(&c->export_map, 16);
|
||||
bmap_reset(&c->export_reject_map, 16);
|
||||
bmap_reset(&c->refeed_map, 16);
|
||||
|
||||
rt_request_export(c->table, req);
|
||||
return;
|
||||
@ -833,7 +835,7 @@ channel_init_feeding(struct channel *c)
|
||||
/* No direct feeding, running auxiliary refeed. */
|
||||
c->refeeding = c->refeed_pending;
|
||||
c->refeed_pending = NULL;
|
||||
c->refeed_trie = f_new_trie(lp_new(c->proto->pool), 0);
|
||||
bmap_reset(&c->refeed_map, 16);
|
||||
|
||||
if (no_trie)
|
||||
{
|
||||
@ -924,11 +926,6 @@ channel_feed_end(struct channel *c)
|
||||
|
||||
/* Drop the refeed batch */
|
||||
c->refeeding = NULL;
|
||||
if (c->refeed_trie)
|
||||
{
|
||||
rfree(c->refeed_trie->lp);
|
||||
c->refeed_trie = NULL;
|
||||
}
|
||||
|
||||
/* Run the pending batch */
|
||||
if (c->refeed_pending)
|
||||
|
@ -583,7 +583,7 @@ struct channel {
|
||||
struct rt_export_request out_req; /* Table export connection */
|
||||
|
||||
struct rt_export_request refeed_req; /* Auxiliary refeed request */
|
||||
struct f_trie *refeed_trie; /* Auxiliary refeed trie */
|
||||
struct bmap refeed_map; /* Auxiliary refeed netindex bitmap */
|
||||
struct channel_feeding_request *refeeding; /* Refeeding the channel */
|
||||
struct channel_feeding_request *refeed_pending; /* Scheduled refeeds */
|
||||
struct channel_import_request *importing; /* Importing the channel */
|
||||
@ -718,11 +718,12 @@ void channel_request_feeding_dynamic(struct channel *c, enum channel_feeding_req
|
||||
static inline int channel_net_is_refeeding(struct channel *c, const net_addr *n)
|
||||
{
|
||||
/* Not refeeding if not refeeding at all */
|
||||
if (!c->refeeding || !c->refeed_trie)
|
||||
if (!c->refeeding)
|
||||
return 0;
|
||||
|
||||
/* Not refeeding if already refed */
|
||||
if (trie_match_net(c->refeed_trie, n))
|
||||
struct netindex *ni = NET_TO_INDEX(n);
|
||||
if (bmap_test(&c->refeed_map, ni->index))
|
||||
return 0;
|
||||
|
||||
/* Refeeding if matching any request */
|
||||
@ -735,8 +736,10 @@ static inline int channel_net_is_refeeding(struct channel *c, const net_addr *n)
|
||||
}
|
||||
static inline void channel_net_mark_refed(struct channel *c, const net_addr *n)
|
||||
{
|
||||
ASSERT_DIE(c->refeeding && c->refeed_trie);
|
||||
trie_add_prefix(c->refeed_trie, n, n->pxlen, n->pxlen);
|
||||
ASSERT_DIE(c->refeeding);
|
||||
|
||||
struct netindex *ni = NET_TO_INDEX(n);
|
||||
bmap_set(&c->refeed_map, ni->index);
|
||||
}
|
||||
|
||||
void channel_request_reload(struct channel *c);
|
||||
|
Loading…
x
Reference in New Issue
Block a user