diff options
author | Pavel Tvrdik <pawel.tvrdik@gmail.com> | 2016-09-06 17:08:45 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-09-15 15:57:51 +0200 |
commit | a290da25a16b7c79d4a7a87f522b4068bca04979 (patch) | |
tree | c11f401192d57553db7f1da17f42f01d225d2194 /nest/route.h | |
parent | bc00f058154bb4a630d24d64a55b5f181d235c63 (diff) |
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)
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nest/route.h b/nest/route.h index bb4674b9..2fcb189a 100644 --- a/nest/route.h +++ b/nest/route.h @@ -276,7 +276,7 @@ void rte_update2(struct announce_hook *ah, net *net, rte *new, struct rte_src *s static inline void rte_update(struct proto *p, net *net, rte *new) { rte_update2(p->main_ahook, net, new, p->main_source); } void rte_discard(rtable *tab, rte *old); int rt_examine(rtable *t, ip_addr prefix, int pxlen, struct proto *p, struct filter *filter); -rte *rt_export_merged(struct announce_hook *ah, net *net, rte **rt_free, struct ea_list **tmpa, int silent); +rte *rt_export_merged(struct announce_hook *ah, net *net, rte **rt_free, struct ea_list **tmpa, linpool *pool, int silent); void rt_refresh_begin(rtable *t, struct announce_hook *ah); void rt_refresh_end(rtable *t, struct announce_hook *ah); void rte_dump(rte *); |