From 7644f7594bb26be2e48eba0ab15600d40e5fb99c Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Thu, 29 Feb 2024 15:08:50 +0100 Subject: [PATCH] Bugfix 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 647476e59..313c2f2c2 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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 ==============="); -- 2.47.2