diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2017-02-22 12:02:28 +0100 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2017-02-22 12:02:28 +0100 |
commit | b2b84359abd382c1ec5a266b211276fbae7da0fc (patch) | |
tree | 7d6bf5b281cae0bc3e979a5ddb348b64197dae2c | |
parent | c609d039860f97f400d2cf0e9ca2b4e87b3fd1cc (diff) |
Babel post-merge fixes
-rw-r--r-- | proto/babel/babel.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 73cb5c3b..1b1d9f62 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -471,21 +471,20 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) if (r) { - rta a0 = { + rta *ap0 = allocz(RTA_MAX_SIZE); + *ap0 = (rta) { .src = p->p.main_source, .source = RTS_BABEL, .scope = SCOPE_UNIVERSE, - .cast = RTC_UNICAST, - .dest = r->metric == BABEL_INFINITY ? RTD_UNREACHABLE : RTD_ROUTER, - .flags = 0, + .dest = r->metric == BABEL_INFINITY ? RTD_UNREACHABLE : RTD_UNICAST, .from = r->neigh->addr, - .iface = r->neigh->ifa->iface, + .nh.iface = r->neigh->ifa->iface, }; 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->u.babel.metric = r->metric; rte->u.babel.router_id = r->router_id; |