]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Babel post-merge fixes
authorJan Moskyto Matejka <mq@ucw.cz>
Wed, 22 Feb 2017 11:02:28 +0000 (12:02 +0100)
committerJan Moskyto Matejka <mq@ucw.cz>
Wed, 22 Feb 2017 11:02:28 +0000 (12:02 +0100)
proto/babel/babel.c

index 73cb5c3bc78c43d27cc467384d726e64f9305b8d..1b1d9f62da4df54ff17f588f6ddd6b0dcfaee55f 100644 (file)
@@ -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;