Fix buffer leak from L2 flooding replication process

vlib_buffer_free_inline actually checks (b->flags & VLIB_BUFFER_RECYCLE)
in order to decide whether to free the packet or not.
Although the flag was correctly set in replication_prep, it is not removed
by replication_recycle during last iteration.

This patch just removes VLIB_BUFFER_RECYCLE when is_last is set.

Change-Id: I2445ebce908d94d95535e706b40407b4f15906e4
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
This commit is contained in:
Pierre Pfister
2016-06-30 14:06:55 +01:00
committed by Dave Barach
parent c4770ecc62
commit 371fa44110

View File

@ -122,6 +122,7 @@ replication_recycle (vlib_main_t * vm,
// This is the last replication in the list.
// Restore original buffer free functionality.
b0->free_list_index = ctx->saved_free_list_index;
b0->flags &= ~VLIB_BUFFER_RECYCLE;
// Free context back to its pool
pool_put (rm->contexts[cpu_number], ctx);