int rt_reload_channel(struct channel *c);
void rt_reload_channel_abort(struct channel *c);
void rt_prune_sync(rtable *t, int all);
-int rte_update_out(struct channel *c, const net_addr *n, rte *new, rte *old0, int refeed);
+int rte_update_out(struct channel *c, const net_addr *n, rte *new, rte *old0, rte **old_free, int refeed);
struct rtable_config *rt_new_table(struct symbol *s, uint addr_type);
void cmd_show_table_stats(struct rtable_config *tab);
{
struct proto *p = c->proto;
struct proto_stats *stats = &c->stats;
+ rte *old_free = NULL;
/*
* First, apply export limit.
}
}
- if (c->out_table && !rte_update_out(c, net->n.addr, new, old, refeed))
+ if (c->out_table && !rte_update_out(c, net->n.addr, new, old, &old_free, refeed))
return;
+ /* Use route from export_table as old */
+ if (old_free)
+ old = old_free;
+
if (new)
stats->exp_updates_accepted++;
else
}
else
p->rt_notify(p, c, net, new, old, new->attrs->eattrs);
+
+ if (old_free)
+ rte_free(old_free);
}
static void
*/
int
-rte_update_out(struct channel *c, const net_addr *n, rte *new, rte *old0, int refeed)
+rte_update_out(struct channel *c, const net_addr *n, rte *new, rte *old0, rte **old_free, int refeed)
{
struct rtable *tab = c->out_table;
struct rte_src *src;
}
/* Remove the old rte */
+ *old_free = old;
*pos = old->next;
- rte_free_quick(old);
tab->route_count--;
break;