diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2017-03-22 14:54:00 +0100 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2017-03-22 14:54:00 +0100 |
commit | ead7b8f498ddefc0b7373cbba78f9a7ba1dddaa9 (patch) | |
tree | 86aa7f38e349b0bdaf31ab30eda0b36427f25c00 /proto/babel | |
parent | da3cf9eae3085d43a2299bae63e6ceb3828856a5 (diff) | |
parent | 61e501da895553abfd2424e56470ab2b457beac4 (diff) |
Merge branch 'nexthop-merged' into int-new
Diffstat (limited to 'proto/babel')
-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; |