summaryrefslogtreecommitdiff
path: root/proto/babel
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-03-22 14:54:00 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2017-03-22 14:54:00 +0100
commitead7b8f498ddefc0b7373cbba78f9a7ba1dddaa9 (patch)
tree86aa7f38e349b0bdaf31ab30eda0b36427f25c00 /proto/babel
parentda3cf9eae3085d43a2299bae63e6ceb3828856a5 (diff)
parent61e501da895553abfd2424e56470ab2b457beac4 (diff)
Merge branch 'nexthop-merged' into int-new
Diffstat (limited to 'proto/babel')
-rw-r--r--proto/babel/babel.c13
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;