0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-20 10:08:43 +00:00

Babel post-merge fixes

This commit is contained in:
Jan Moskyto Matejka 2017-02-22 12:02:28 +01:00
parent c609d03986
commit b2b84359ab

View File

@ -471,21 +471,20 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
if (r) if (r)
{ {
rta a0 = { rta *ap0 = allocz(RTA_MAX_SIZE);
*ap0 = (rta) {
.src = p->p.main_source, .src = p->p.main_source,
.source = RTS_BABEL, .source = RTS_BABEL,
.scope = SCOPE_UNIVERSE, .scope = SCOPE_UNIVERSE,
.cast = RTC_UNICAST, .dest = r->metric == BABEL_INFINITY ? RTD_UNREACHABLE : RTD_UNICAST,
.dest = r->metric == BABEL_INFINITY ? RTD_UNREACHABLE : RTD_ROUTER,
.flags = 0,
.from = r->neigh->addr, .from = r->neigh->addr,
.iface = r->neigh->ifa->iface, .nh.iface = r->neigh->ifa->iface,
}; };
if (r->metric < BABEL_INFINITY) if (r->metric < BABEL_INFINITY)
a0.gw = r->next_hop; ap0->nh.gw = r->next_hop;
rta *a = rta_lookup(&a0); rta *a = rta_lookup(ap0);
rte *rte = rte_get_temp(a); rte *rte = rte_get_temp(a);
rte->u.babel.metric = r->metric; rte->u.babel.metric = r->metric;
rte->u.babel.router_id = r->router_id; rte->u.babel.router_id = r->router_id;