Commit ea3c6c1a authored by Ondřej Zajíček's avatar Ondřej Zajíček
Browse files

Static: Fix handling of 'net' attribute in per-route filters

We need to define 'net' field temporarily as it may be accessed by
per-route filters.

Thanks to Damian Zaremba for the bugreport.
parent 9e263550
Pipeline #74091 passed with stages
in 12 minutes and 28 seconds
......@@ -106,8 +106,19 @@ static_announce_rte(struct static_proto *p, struct static_route *r)
e->pflags = 0;
if (r->cmds)
{
/* Create a temporary table node */
e->net = alloca(sizeof(net) + r->net->length);
memset(e->net, 0, sizeof(net) + r->net->length);
net_copy(e->net->n.addr, r->net);
/* Evaluate the filter */
f_eval_rte(r->cmds, &e, static_lp);
/* Remove the temporary node */
e->net = NULL;
}
rte_update2(p->p.main_channel, r->net, e, a->src);
r->state = SRS_CLEAN;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment