1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

rt-table: Fix kernel protocol export filter memory bug

Kernel protocol calls rt_export_merged(), which used @rte_update_pool for
temporary allocations, supposing it is called from other functions from
rt-table.c that handles locking and flushing of the linpool. Therefore,
linpool was not flushed properly and memory leaked.

Add linpool argument to rt_export_merged() and use @krt_filter_lp when
called from kernel protocol.

Thanks to Justin Cattle and Alexander Frolkin for the bugreport.

(Commit squashed and updated by Ondrej Zajicek)
This commit is contained in:
Pavel Tvrdik
2016-09-06 17:08:45 +02:00
committed by Ondrej Zajicek (work)
parent bc00f05815
commit a290da25a1
3 changed files with 21 additions and 15 deletions

View File

@@ -613,7 +613,7 @@ krt_export_net(struct krt_proto *p, net *net, rte **rt_free, ea_list **tmpa)
rte *rt;
if (p->p.accept_ra_types == RA_MERGED)
return rt_export_merged(ah, net, rt_free, tmpa, 1);
return rt_export_merged(ah, net, rt_free, tmpa, krt_filter_lp, 1);
rt = net->routes;
*rt_free = NULL;