mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Split route data structure to storage (ro) / manipulation (rw) structures.
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
This commit is contained in:
committed by
Maria Matejka
parent
60880b539b
commit
69d1ffde4c
@@ -67,13 +67,10 @@ dev_ifa_notify(struct proto *P, uint flags, struct ifa *ad)
|
||||
|
||||
/* Use iface ID as local source ID */
|
||||
struct rte_src *src = rt_get_source(P, ad->iface->index);
|
||||
rte_update2(c, net, NULL, src);
|
||||
rte_update(c, net, NULL, src);
|
||||
}
|
||||
else if (flags & IF_CHANGE_UP)
|
||||
{
|
||||
rta *a;
|
||||
rte *e;
|
||||
|
||||
DBG("dev_if_notify: %s:%I going up\n", ad->iface->name, ad->ip);
|
||||
|
||||
if (cf->check_link && !(ad->iface->flags & IF_LINK_UP))
|
||||
@@ -90,10 +87,12 @@ dev_ifa_notify(struct proto *P, uint flags, struct ifa *ad)
|
||||
.nh.iface = ad->iface,
|
||||
};
|
||||
|
||||
a = rta_lookup(&a0);
|
||||
e = rte_get_temp(a, src);
|
||||
e->pflags = 0;
|
||||
rte_update2(c, net, e, src);
|
||||
rte e0 = {
|
||||
.attrs = rta_lookup(&a0),
|
||||
.src = src,
|
||||
};
|
||||
|
||||
rte_update(c, net, &e0, src);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user