From: Maria Matejka Date: Wed, 9 Mar 2022 12:37:12 +0000 (+0100) Subject: Merge commit '575da88f' into haugesund X-Git-Tag: v3.0-alpha1~171^2~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01c9f3d78e596336434fd313e4ed8bdc8db248b6;p=thirdparty%2Fbird.git Merge commit '575da88f' into haugesund Conflicts: nest/rt-table.c --- 01c9f3d78e596336434fd313e4ed8bdc8db248b6 diff --cc nest/rt-table.c index 9a9d57ad3,837e0ab9f..2fa4f5160 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@@ -2516,28 -1870,29 +2516,32 @@@ rt_flowspec_update_rte(rtable *tab, ne static inline int rt_next_hop_update_net(rtable *tab, net *n) { - struct rte_storage **k, *e, *new, *old_best, **new_best; + struct rte_storage *new; int count = 0; - int free_old_best = 0; ++ int is_flow = net_is_flow(n->n.addr); - old_best = n->routes; + struct rte_storage *old_best = n->routes; if (!old_best) return 0; - for (k = &n->routes; e = *k; k = &e->next) - { - if (!net_is_flow(n->n.addr)) - new = rt_next_hop_update_rte(tab, n, &e->rte); - else - new = rt_flowspec_update_rte(tab, n, &e->rte); + for (struct rte_storage *e, **k = &n->routes; e = *k; k = &e->next) - if (rta_next_hop_outdated(e->rte.attrs)) ++ if (is_flow || rta_next_hop_outdated(e->rte.attrs)) + count++; - if (new) - { - new->next = e->next; - *k = new; + if (!count) + return 0; + + struct rte_multiupdate { + struct rte_storage *old, *new; + } *updates = alloca(sizeof(struct rte_multiupdate) * count); - rte_trace_in(D_ROUTES, new->rte.sender, &new->rte, "updated"); - rte_announce_i(tab, RA_ANY, n, new, e, NULL, NULL); + int pos = 0; + for (struct rte_storage *e, **k = &n->routes; e = *k; k = &e->next) - if (rta_next_hop_outdated(e->rte.attrs)) ++ if (is_flow || rta_next_hop_outdated(e->rte.attrs)) + { - struct rte_storage *new = rt_next_hop_update_rte(tab, n, &e->rte); ++ struct rte_storage *new = is_flow ++ ? rt_flowspec_update_rte(tab, n, &e->rte) ++ : rt_next_hop_update_rte(tab, n, &e->rte); /* Call a pre-comparison hook */ /* Not really an efficient way to compute this */