mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
KRT: Improve syncer code to avoid using temporary data in rtable
The old code stored route verdicts and temporary routes directly in rtable. The new code do not store received routes (it immediately compares them with exported routes and resolves conflicts) and uses internal bitmap to keep track of which routes were received and which needs to be reinstalled. By not putting 'invalid' temporary routes to rtable, we keep rtable in consistent state, therefore scan no longer needs to be atomic operation and could be splitted to multiple events.
This commit is contained in:
@@ -37,7 +37,6 @@ struct cli;
|
||||
struct fib_node {
|
||||
struct fib_node *next; /* Next in hash chain */
|
||||
struct fib_iterator *readers; /* List of readers of this node */
|
||||
byte flags; /* User-defined, will be removed */
|
||||
net_addr addr[0];
|
||||
};
|
||||
|
||||
|
||||
@@ -327,7 +327,6 @@ fib_get(struct fib *f, const net_addr *a)
|
||||
|
||||
struct fib_node *e = fib_user_to_node(f, b);
|
||||
e->readers = NULL;
|
||||
e->flags = 0;
|
||||
fib_insert(f, a, e);
|
||||
|
||||
memset(b, 0, f->node_offset);
|
||||
|
||||
@@ -1687,7 +1687,7 @@ rte_dump(rte *e)
|
||||
{
|
||||
net *n = e->net;
|
||||
debug("%-1N ", n->n.addr);
|
||||
debug("KF=%02x PF=%02x pref=%d ", n->n.flags, e->pflags, e->pref);
|
||||
debug("PF=%02x pref=%d ", e->pflags, e->pref);
|
||||
rta_dump(e->attrs);
|
||||
if (e->attrs->src->proto->proto->dump_attrs)
|
||||
e->attrs->src->proto->proto->dump_attrs(e);
|
||||
|
||||
Reference in New Issue
Block a user