]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Bugfix
authorIgor Putovny <igor.putovny@nic.cz>
Thu, 29 Feb 2024 14:08:50 +0000 (15:08 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
Program crashed when disabling aggregation protocol or shutting the daemon down.
Shutdown procedure attempted to remove the first route (which is the last that
was inserted) by different key than one by which it was inserted into the table.
They key is computed from net and src of each route. It turned out that src of
the last route was inadvertently changed.

proto/aggregator/aggregator.c

index 647476e59c27a0e1b57687961c9c32198e977dcf..313c2f2c270460a091f40d1e153526b885e5e35d 100644 (file)
@@ -700,7 +700,6 @@ create_route_ip4(struct aggregator_proto *p, const struct net_addr_ip4 *addr, st
 
   assert(addr->type == NET_IP4);
   net_copy_ip4((struct net_addr_ip4 *)&net_placeholder.net.n.addr, addr);
-  bucket->rte->src = p->p.main_source;
   aggregator_bucket_update(p, bucket, &net_placeholder.net);
 }
 
@@ -714,7 +713,6 @@ create_route_ip6(struct aggregator_proto *p, struct net_addr_ip6 *addr, struct a
 
   assert(addr->type == NET_IP6);
   net_copy_ip6((struct net_addr_ip6 *)&net_placeholder.n.n.addr, addr);
-  bucket->rte->src = p->p.main_source;
   aggregator_bucket_update(p, bucket, &net_placeholder.n);
 }
 
@@ -971,7 +969,7 @@ aggregator_bucket_update(struct aggregator_proto *p, struct aggregator_bucket *b
       rta_set_static_attr(rta, bucket->rte->attrs, p->aggr_on[i].sa);
   }
 
-  struct rte *new = rte_get_temp(rta, bucket->rte->src);
+  struct rte *new = rte_get_temp(rta, p->p.main_source);
   new->net = net;
 
   log("=============== CREATE MERGED ROUTE ===============");